Skip to content

Commit e9e697f

Browse files
author
Anand
committed
ref issue #10 - Search multiple terms using AND operator
1 parent e879b0e commit e9e697f

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

actions.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -511,12 +511,15 @@ func findCurrentEntry(term string) error {
511511

512512
var err error
513513
var entries []Entry
514+
var terms []string
514515

515516
if err = checkActiveDatabase(); err != nil {
516517
return err
517518
}
518519

519-
err, entries = searchDatabaseEntry(term)
520+
terms = strings.Split(term, " ")
521+
522+
err, entries = searchDatabaseEntries(terms, "AND")
520523
if err != nil || len(entries) == 0 {
521524
fmt.Printf("Entry for query \"%s\" not found\n", term)
522525
return err

0 commit comments

Comments
 (0)