Explorar o código

HUE-7827 [search] Switch to fuzzy matching for autocomplete term search

Romain Rigaux %!s(int64=8) %!d(string=hai) anos
pai
achega
2e9e60f297
Modificáronse 1 ficheiros con 1 adicións e 1 borrados
  1. 1 1
      desktop/libs/dashboard/src/dashboard/api.py

+ 1 - 1
desktop/libs/dashboard/src/dashboard/api.py

@@ -257,7 +257,7 @@ def get_terms(request):
       # maxcount
     }
     if analysis['terms']['prefix']:
-      properties['terms.regex'] = '^%(prefix)s.*' % analysis['terms'] # Case insensitive 'terms.prefix'
+      properties['terms.regex'] = '.*%(prefix)s.*' % analysis['terms'] # Use regexp instead of case sensitive 'terms.prefix'
       properties['terms.regex.flag'] = 'case_insensitive'
 
     result['terms'] = SolrApi(SOLR_URL.get(), request.user).terms(collection['name'], field, properties)