setAccuracy

suggestSimilar

As the Lucene similarity that is used to fetch the most relevant n-grammed terms
is not the same as the edit distance strategy used to calculate the best
matching spell-checked word from the hits that Lucene found, one usually has
to retrieve a couple of numSug's in order to get the true best match.

I.e. if numSug == 1, don't count on that suggestion being the best one.
Thus, you should set this value to at least 5 for a good suggestion.

suggestSimilar

As the Lucene similarity that is used to fetch the most relevant n-grammed terms
is not the same as the edit distance strategy used to calculate the best
matching spell-checked word from the hits that Lucene found, one usually has
to retrieve a couple of numSug's in order to get the true best match.

I.e. if numSug == 1, don't count on that suggestion being the best one.
Thus, you should set this value to at least 5 for a good suggestion.

Parameters:

word - the word you want a spell check done on

numSug - the number of suggested words

ir - the indexReader of the user index (can be null see field param)

field - the field of the user index: if field is not null, the suggested
words are restricted to the words present in this field.

morePopular - return only the suggest words that are more frequent than the searched word
(only if restricted mode = (indexReader!=null and field!=null)

Returns:

String[] the sorted list of the suggest words with these 2 criteria:
first criteria: the edit distance, second criteria (only if restricted mode): the popularity
of the suggest words in the field of the user index