public interface Suggester
index
to look up the suggestions.
The spell check is done by leveraging the JCR full text search index.
The index can be created in various ways: by analysing most frequently used
terms in the full text index (see SearchIndexSuggestionExtractor
), by
tracking actual search statistics (see QueryTracker
, requires
configuration to synchronize with multiple publish instances) or by a custom
index creator (use SuggestionIndexManager
to create indexes).
Given that the indexes won't change very often, they should be created in the background, and they can be distributed to publish instances via content packages.
Modifier and Type | Method and Description |
---|---|
java.lang.String[] |
getSuggestions(Session session,
java.lang.String indexName,
java.lang.String term,
boolean spellCheck)
Returns suggestions for a given term, which can be any partial word of at
least one character.
|
java.lang.String[] |
getSuggestions(java.lang.String indexName,
java.lang.String term,
boolean spellCheck)
Deprecated.
use the variant with a user session argument:
getSuggestions(Session, String, String, boolean) |
java.lang.String |
spellCheck(Session session,
java.lang.String term)
Uses the JCR search index to run a spellcheck for the given word.
|
java.lang.String |
spellCheck(java.lang.String term)
Deprecated.
use the variant with a user session argument:
spellCheck(Session, String) |
java.lang.String[] getSuggestions(Session session, java.lang.String indexName, java.lang.String term, boolean spellCheck)
session
- user session to access indexindexName
- a path or name for the suggestion indexterm
- partial word to look up suggestions forspellCheck
- if true
, the term will be spell checked if
nothing was found and the suggestion look up will be retried
with the spell check resultjava.lang.String spellCheck(Session session, java.lang.String term)
rep:spellcheck()
Xpath function. Will return a
single spell checked term or null
if the term is already
correctly spelled or if no match was found.session
- user session to run spellcheck on repository index(es)term
- the term to spell checknull
@Deprecated java.lang.String[] getSuggestions(java.lang.String indexName, java.lang.String term, boolean spellCheck)
getSuggestions(Session, String, String, boolean)
indexName
- a path or name for the suggestion indexterm
- partial word to look up suggestions forspellCheck
- if true
, the term will be spell checked if
nothing was found and the suggestion look up will be retried
with the spell check result@Deprecated java.lang.String spellCheck(java.lang.String term)
spellCheck(Session, String)
rep:spellcheck()
Xpath function. Will return a
single spell checked term or null
if the term is already
correctly spelled or if no match was found.term
- the term to spell checknull
"Copyright © 2010 - 2020 Adobe Systems Incorporated. All Rights Reserved"