- Predictive Search
- Spell Check
Prerequisites:
You need to have at least OAK 1.1.6 to enable a predictive search in AEM.
AEM 6.1 ships with a higher OAK version, so in a way, this feature is available in OOTB installation. However, if your application runs on AEM 6.0, you might want to check the OAK version and bring it up to at least 1.1.6
Configuration:
Predictive search can be configured in AEM 6.x using the following simple steps:
you can add other properties like jcr:title depending upon the requirement.
SELECT [rep:suggest()] FROM nt:base WHERE [jcr:path] = '/' AND SUGGEST('keyword')
You need to have at least OAK 1.1.6 to enable a predictive search in AEM.
AEM 6.1 ships with a higher OAK version, so in a way, this feature is available in OOTB installation. However, if your application runs on AEM 6.0, you might want to check the OAK version and bring it up to at least 1.1.6
Configuration:
Predictive search can be configured in AEM 6.x using the following simple steps:
- Configure a lucene index for word suggestions
/oak:index/lucene-suggest
- jcr:primaryType = "oak:QueryIndexDefinition"
- compatVersion = 2
- type = "lucene"
- async = "async"
- suggestUpdateFrequencyMinutes = 60
+ indexRules
- jcr:primaryType = "nt:unstructured"
+ nt:base
+ properties
- jcr:primaryType = "nt:unstructured"
+ jcr:description
- propertyIndex = true
- analyzed = true
- useInSuggest = true
you can add other properties like jcr:title depending upon the requirement.
- Using property rep:suggest() to retrieve word suggestions.
SELECT [rep:suggest()] FROM nt:base WHERE [jcr:path] = '/' AND SUGGEST('keyword')
Spell Check Support
Enabling spell check requires the same steps as that of predictive search. You need OAK 1.1.6 to get this working.
Configuration:
The following lucene index needs to be created first
rep:spellcheck() can be used for getting spell suggestions as used in the following query :
SELECT [rep:spellcheck()] FROM nt:base WHERE [jcr:path] = '/' AND SPELLCHECK('keyword').
Enabling spell check requires the same steps as that of predictive search. You need OAK 1.1.6 to get this working.
Configuration:
The following lucene index needs to be created first
/oak:index/lucene-spellcheck
- jcr:primaryType = "oak:QueryIndexDefinition"
- compatVersion = 2
- type = "lucene"
- async = "async"
+ indexRules
- jcr:primaryType = "nt:unstructured"
+ nt:base
+ properties
- jcr:primaryType = "nt:unstructured"
+ jcr:title
- propertyIndex = true
- analyzed = true
- useInSpellcheck = true
rep:spellcheck() can be used for getting spell suggestions as used in the following query :
SELECT [rep:spellcheck()] FROM nt:base WHERE [jcr:path] = '/' AND SPELLCHECK('keyword').
No comments:
Post a Comment
If you have any doubts or questions, please let us know.