Pārlūkot izejas kodu

HUE-6815 [frontend] Adjust the global search parser to also suggest results

Johan Ahlen 8 gadi atpakaļ
vecāks
revīzija
ac1f1e6d42

Failā izmaiņas netiks attēlotas, jo tās ir par lielu
+ 0 - 0
desktop/core/src/desktop/static/desktop/js/autocomplete/globalSearchParser.js


+ 2 - 2
desktop/core/src/desktop/static/desktop/js/autocomplete/jison/globalSearchParser.jison

@@ -46,7 +46,7 @@
 
 <doubleQuote>\"                                 { this.popState(); return 'QUOTE'; }
 
-[^"'\u2020]+                                    { return 'TEXT'; }
+[^"'\s\u2020]+                                    { return 'TEXT'; }
 
 <<EOF>>                                         { return 'EOF'; }
 
@@ -126,7 +126,7 @@ FreeText
  ;
 
 FreeText_EDIT
- : 'CURSOR'             --> { suggestFacets: true }
+ : 'CURSOR'             --> { suggestFacets: true, suggestResults: true }
  | QuotedValue_EDIT
  ;
 

+ 9 - 0
desktop/core/src/desktop/static/desktop/spec/autocomplete/globalSearchParserSpec.js

@@ -24,6 +24,7 @@
     it('should suggest facets for "|"', function () {
       testParser('', '', {
         suggestFacets: true,
+        suggestResults: true,
         facets: [ ]
       });
     });
@@ -31,10 +32,18 @@
     it('should suggest facets for "TAGS: asdf |"', function () {
       testParser('TAGS: asdf ', '', {
         suggestFacets: true,
+        suggestResults: true,
         facets: [ 'TAGS' ]
       });
     });
 
+    it('should suggest facet values for "type:table tags:"', function() {
+      testParser('type:table tags: ', '', {
+        suggestFacetValues: 'tags',
+        facets: ['type']
+      });
+    });
+
     it('should suggest facet values for "tags: |"', function () {
       testParser('tags: ', '', {
         suggestFacetValues: 'tags',

Daži faili netika attēloti, jo izmaiņu fails ir pārāk liels