Highlighted

AEM Suggester Index

Avatar

Avatar

cristianb256715

Avatar

cristianb256715

cristianb256715

19-06-2019

Hi. I'm using AEM 6.4 and using the out of the box Suggester service like this:

for (final String suggestion : suggester.getSuggestions(session, INDEX, keyword, spellCheck)) {

[...]

suggestions.add(suggestion);

}


where INDEX is :

private static final String INDEX = "oak-cq:Page";



The suggester works great, returning what I'm expecting, with one small problem.

I want to only have suggestions from my project, not from we-retail as well.


I've tried making a custom index "lucene-suggest" and put it below my content/desiredProject. But, I don't know how to have my suggester use this index.


Any help is welcomed,

Thank you.

Replies

Highlighted

Avatar

Avatar

cquser1

Avatar

cquser1

cquser1

19-06-2019

Just a thought.

Are you having we-retail content in the production environment. Guess we can exclude those pages.

Highlighted

Avatar

Avatar

jbrar

Employee

Avatar

jbrar

Employee

jbrar
Employee

19-06-2019

You can use Include/Exclude paths property on the index so that it is only indexing custom project related pages.Also, starting AEM instance with nosamplecontent will remove the we-retail content. Check [1] for more details

[1] Jackrabbit Oak – Lucene Index

Highlighted

Avatar

Avatar

cristianb256715

Avatar

cristianb256715

cristianb256715

19-06-2019

In production environment I will have two other projects on the same instance. I tried to simplify this by saying we-retail.

So there will be no we-retail, but there will be others.

Highlighted

Avatar

Avatar

akashk22786878

Employee

Avatar

akashk22786878

Employee

akashk22786878
Employee

19-06-2019

You can use the AEM explain tool to see if your query is picking your index or not. If it is picking some OOTB index then you can compare and understand why the cost of OOTB index is less than yours.  Please refer to [1] for creating index as per your query and [2] for details on explain query tool.

[1] Oak Utilities : Index Definition Generator

[2] Operations Dashboard

Highlighted

Avatar

Avatar

cristianb256715

Avatar

cristianb256715

cristianb256715

19-06-2019

I may have not made myself understood.

This is not an index configuring problem, but, my problem is that I do not know how to reference the index I've created in my suggester.