Method SuggestWordCombinations
SuggestWordCombinations(Term[], Int32, IndexReader, SuggestMode)
Generate suggestions by combining one or more of the passed-in terms into single words. The returned CombineSuggestion contains both a SuggestWord and also an array detailing which passed-in terms were involved in creating this combination. The scores returned are equal to the number of word combinations needed, also one less than the length of the array OriginalTermIndexes. Generally, a suggestion with a lower score is preferred over a higher score.
To prevent two adjacent terms from being combined (for instance, if one is mandatory and the other is prohibited), separate the two terms with SEPARATOR_TERM
When suggestMode equals SUGGEST_WHEN_NOT_IN_INDEX, each suggestion will include at least one term not in the index.
When suggestMode equals SUGGEST_MORE_POPULAR, each suggestion will have the same, or better frequency than the most-popular included term.
Declaration
public virtual CombineSuggestion[] SuggestWordCombinations(Term[] terms, int maxSuggestions, IndexReader ir, SuggestMode suggestMode = default(SuggestMode))
Parameters
Type | Name | Description |
---|---|---|
Term[] | terms | |
System.Int32 | maxSuggestions | |
IndexReader | ir | |
SuggestMode | suggestMode |
Returns
Type | Description |
---|---|
CombineSuggestion[] | an array of words generated by combining original terms |