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

disable "textgrams" when minPrefixChars=0 AnalyzingInfixSuggester

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • None
    • 7.1, 8.0
    • None
    • None
    • New

    Description

      The current code allows to set minPrefixChars=0, but it creates an unnecessary textgrams field, and might bring significant footprint. Bypassing it keeps existing tests green.

              if (fieldName.equals("textgrams") && minPrefixChars > 0) {
                TokenFilter filter = new EdgeNGramTokenFilter(components.getTokenStream(), 1, minPrefixChars);
                return new TokenStreamComponents(components.getTokenizer(), filter);
              } else {
                return components; // threre is no sense to go here if minPrefixChars==0 and fieldName=="textgrams"
              }
      

      Attachments

        1. LUCENE-7827.patch
          3 kB
          Mikhail Khludnev
        2. LUCENE-7827.patch
          5 kB
          Mikhail Khludnev
        3. LUCENE-7827.patch
          5 kB
          Mikhail Khludnev
        4. LUCENE-7827.patch
          3 kB
          Mikhail Khludnev
        5. LUCENE-7827.patch
          0.9 kB
          Mikhail Khludnev

        Issue Links

          Activity

            People

              Unassigned Unassigned
              mkhl Mikhail Khludnev
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: