fix arguments to index search

This commit is contained in:
A.Unger
2020-10-20 10:58:52 +02:00
parent 7cf4f0a81f
commit 590dd8660b
+2 -1
View File
@@ -167,10 +167,11 @@ func (i Indexer) FindByPartial(t interface{}, field string, pattern string) ([]s
if fields, ok := i.indices[typeName]; ok {
for _, idx := range fields.IndicesByField[field] {
idxPattern := pattern
// TODO: CaseInsensitive is leaking implementation. Should be moved to the implementation instead.
if idx.CaseInsensitive() {
idxPattern = strings.ToLower(idxPattern)
}
res, err := idx.Search(pattern)
res, err := idx.Search(idxPattern)
if err != nil {
if errors.IsNotFoundErr(err) {
continue