Added direction notes
This commit is contained in:
@@ -58,14 +58,21 @@ func Parse( line string, entries *[] ISearchable ) ( *QueryObject, error ) {
|
||||
return &QueryObject{ Key: Key, Results: &matches, SearchTerms: &terms }, nil
|
||||
} else if 0 < len( terms ) {
|
||||
for _, entry := range *entries {
|
||||
anyFailed := false
|
||||
for _, term := range terms {
|
||||
if term.IsKey {
|
||||
continue
|
||||
}
|
||||
if ( Key == "" || Key == *entry.GetKey() ) && entry.Test( term.Value ) {
|
||||
matches = append( matches, entry )
|
||||
|
||||
if !( ( Key == "" || Key == *entry.GetKey() ) && entry.Test( term.Value ) ) {
|
||||
anyFailed = true
|
||||
break
|
||||
}
|
||||
}
|
||||
|
||||
if !anyFailed {
|
||||
matches = append( matches, entry )
|
||||
}
|
||||
}
|
||||
return &QueryObject{ Key: Key, Results: &matches, SearchTerms: &terms }, nil
|
||||
}
|
||||
|
Reference in New Issue
Block a user