Uploaded image for project: 'Lucene - Core'
  1. Lucene - Core
  2. LUCENE-6149

Infix suggesters' highlighting, allTermsRequired options are hardwired and not configurable for non-contextual lookup

Details

    • Improvement
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 4.9, 4.10.1, 4.10.2, 4.10.3
    • 5.0, 6.0
    • modules/other

    Description

      Highlighting and allTermsRequired are hardwired in AnalyzingInfixSuggester for non-contextual lookup (via Lookup) see true, true below:

      AnalyzingInfixSuggester.java (extends Lookup.java)
      public List<LookupResult> lookup(CharSequence key, Set<BytesRef> contexts, boolean onlyMorePopular, int num) throws IOException {
          return lookup(key, contexts, num, true, true);
      }
      
      /** Lookup, without any context. */
      public List<LookupResult> lookup(CharSequence key, int num, boolean allTermsRequired, boolean doHighlight) throws IOException {
          return lookup(key, null, num, allTermsRequired, doHighlight);
        }
      
      Lookup.java
      public List<LookupResult> lookup(CharSequence key, boolean onlyMorePopular, int num) throws IOException {
          return lookup(key, null, onlyMorePopular, num);
      }
      

      The above means the majority of the current infix suggester lookup always return highlighted results with allTermsRequired in effect. There is no way to change this despite the options and improvement of LUCENE-6050, made to incorporate Boolean lookup clauses (MUST/SHOULD). This shortcoming has also been reported in SOLR-6648.

      The suggesters (AnalyzingInfixSuggester, BlendedInfixSuggester) should provide a proper mechanism to set defaults for highlighting and "allTermsRequired", e.g. in constructors (and in Solr factories, thus configurable via solrconfig.xml).

      Attachments

        1. LUCENE-6149.patch
          10 kB
          Tomas Eduardo Fernandez Lobbe
        2. LUCENE-6149.patch
          10 kB
          Tomas Eduardo Fernandez Lobbe
        3. LUCENE-6149.patch
          9 kB
          Boon Low
        4. LUCENE-6149-v4.10.3.patch
          9 kB
          Boon Low

        Issue Links

          Activity

            People

              tflobbe Tomas Eduardo Fernandez Lobbe
              boonious Boon Low
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: