You are viewing a plain text version of this content. The canonical link for it is here.
Posted to oak-issues@jackrabbit.apache.org by "Tommaso Teofili (JIRA)" <ji...@apache.org> on 2015/02/17 15:11:13 UTC

[jira] [Updated] (OAK-2531) Suggest field doesn't get stored if it has only one value

     [ https://issues.apache.org/jira/browse/OAK-2531?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Tommaso Teofili updated OAK-2531:
---------------------------------
    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 it {{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:
{noformat}
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)
{noformat}

  was:
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 value (e.g. a Lucene property index on _jcr:primaryType_) the value is not stored as it {{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:
{noformat}
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)
{noformat}


> Suggest field doesn't get stored if it has only one value
> ---------------------------------------------------------
>
>                 Key: OAK-2531
>                 URL: https://issues.apache.org/jira/browse/OAK-2531
>             Project: Jackrabbit Oak
>          Issue Type: Bug
>          Components: oak-lucene
>    Affects Versions: 1.1.6
>            Reporter: Tommaso Teofili
>            Assignee: Tommaso Teofili
>             Fix For: 1.1.7
>
>
> 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 it {{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:
> {noformat}
> 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)
> {noformat}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)