Uploaded image for project: 'Jackrabbit Oak'
  1. Jackrabbit Oak
  2. OAK-2531

Suggest field doesn't get stored if it has only one value

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 1.1.6
    • 1.0.15, 1.1.7
    • lucene
    • None

    Description

      Because of LUCENE-5833 we have to do merge the :suggest field values in one single valued field, however in case there's only one text value for suggestions (e.g. a Lucene property index on jcr:primaryType) the value is not stored as LuceneIndexEditor uses the previously set field newPropertyField(FieldNames.SUGGEST, value, true, false) instead of FieldFactory.newSuggestField(f.stringValue()) causing the building of the suggester dictionary to fail with:

      org.apache.jackrabbit.oak.plugins.index.lucene.util.SuggestHelper could not update the suggester
      java.lang.IllegalArgumentException: need at least one suggestion
          at org.apache.lucene.search.suggest.analyzing.FreeTextSuggester.build(FreeTextSuggester.java:338)
          at org.apache.lucene.search.suggest.analyzing.FreeTextSuggester.build(FreeTextSuggester.java:278)
          at org.apache.lucene.search.suggest.Lookup.build(Lookup.java:165)
          at org.apache.jackrabbit.oak.plugins.index.lucene.util.SuggestHelper.updateSuggester(SuggestHelper.java:64)
          at org.apache.jackrabbit.oak.plugins.index.lucene.LuceneIndexEditorContext.updateSuggester(LuceneIndexEditorContext.java:188)
      

      Attachments

        Activity

          People

            teofili Tommaso Teofili
            teofili Tommaso Teofili
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: