Expand my Community achievements bar.

lucene search suggestion Results issue

Avatar

Level 2

Hi Experts,

 

We are using AEM 6.4.7 with Lucene Search functionality with oak indexing.  When ever the below query runs the suggestions gives results but only 255 characters even though the Description have 500 characters.

 

SELECT [rep:suggest()] FROM [nt:base] AS s WHERE suggest('Our ') AND ISDESCENDANTNODE(s, '/content/path') AND NOT [hideInSearch] = "true" .

 

 Please suggest do we need to add any config to give full sentence of the description.

 

Note: We are indexing pageTitle and Description of the page.

 

6 Replies

Avatar

Community Advisor

Hi @prathapm1847112,

Could you please let know the index used when this query is executed.

I assume it to be custom index definition. If yes, can you share the config/property details that you added specific to suggest functionality. 

Avatar

Level 2

Hi Thanks for the reply. We are using custom index for suggestions. Please see the below.

 

Hi VijayaLakshmi,

 

I am using the below custom index.

<my-suggest
jcr:primaryType="oak:QueryIndexDefinition"
async="async"
compatVersion="{Long}2"
evaluatePathRestrictions="{Boolean}true"
excludedPaths="[/rep:policy,/usergenerated,/projects,/campaigns,/phonegap,/mobileapps,/launches,/publications,/entities,/forms,/screens,/communities,/sites,/community-components,/catalogs,/experience-fragments,/we-retail,/oak:index,/install,/packages]"
indexPath="/oak:index/my-suggest"
reindex="{Boolean}false"
reindexCount="{Long}5"
seed="{Long}-4556624132782666122"
type="lucene">
<indexRules jcr:primaryType="nt:unstructured">
<nt:base jcr:primaryType="nt:unstructured">
<properties jcr:primaryType="nt:unstructured">
<pageTitle
jcr:primaryType="nt:unstructured"
analyzed="{Boolean}true"
nodeScopeIndex="{Boolean}true"
useInSuggest="{Boolean}true"/>
<jcr:description
jcr:primaryType="nt:unstructured"
analyzed="{Boolean}true"
nodeScopeIndex="{Boolean}true"
useInSuggest="{Boolean}true"/>
<dcDescription
jcr:primaryType="nt:unstructured"
analyzed="{Boolean}true"
name="dc:description"
nodeScopeIndex="{Boolean}true"
useInSuggest="{Boolean}true"/>
</properties>
</nt:base>
</indexRules>
<suggestions
jcr:primaryType="nt:unstructured"
suggestAnalyzed="{Boolean}true"/>
</my-suggest>

 

Please let me know your thoughts on this.

Avatar

Community Advisor

Hi @prathapm1847112,

Can you remove the "suggestAnalyzed" property on suggestion node -> reindex and then test.

This property uses index Analyzer for fine grained suggestion values whereas default suggest configuration return entire property value.

Avatar

Level 2
Hi VijayaLakshmi, I tried that solution still its giving only 255 characters.

Avatar

Community Advisor

Hi @prathapm1847112,

Per Apache Jackrabbit Oak Lucene Index official documentation, there is no other config with respect to the suggestion result character limit. 

However I surfed about this from Apache Lucene perspective which uses FST completion/ Look up for autocomplete functionality. 

Couldn't arrive at complete flow because of the hidden implementation but found something related to constraint on Buckets

Did you see any exception log something like below line 

"Buckets must be >= 1 and <= 255:"

Avatar

Community Advisor

we got similar issue , as a workaround i have switched the query from suggestion to search result query