Browse Source

HUE-7827 [search] Case insensitive term search for the autocomplete

Romain Rigaux 8 years ago
parent
commit
0d09d5a
1 changed files with 2 additions and 2 deletions
  1. 2 2
      desktop/libs/dashboard/src/dashboard/api.py

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

@@ -252,13 +252,13 @@ def get_terms(request):
     properties = {
       'terms.limit': limit,
       'terms.distrib': str(support_distributed).lower(),
-      # terms.regex
       # lower
       # mincount
       # maxcount
     }
     if analysis['terms']['prefix']:
-      properties['terms.prefix'] = analysis['terms']['prefix']
+      properties['terms.regex'] = '^%(prefix)s.*' % analysis['terms'] # Case insensitive 'terms.prefix'
+      properties['terms.regex.flag'] = 'case_insensitive'
 
     result['terms'] = SolrApi(SOLR_URL.get(), request.user).terms(collection['name'], field, properties)