Class WordAssociation
- java.lang.Object
-
- de.cxp.ocs.elasticsearch.query.model.WordAssociation
-
- All Implemented Interfaces:
QueryStringTerm
public class WordAssociation extends Object implements QueryStringTerm
A term that is associated with other terms (e.g. synonyms). They all will be searched together each one as an optional replacement for the actual word.
-
-
Constructor Summary
Constructors Constructor Description WordAssociation(String word, Collection<WeightedWord> values)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description StringgetWord()voidputOrUpdate(WeightedWord newWord)StringtoQueryString()builds a query likeStringtoString()-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface de.cxp.ocs.elasticsearch.query.model.QueryStringTerm
getOccur
-
-
-
-
Constructor Detail
-
WordAssociation
public WordAssociation(String word, Collection<WeightedWord> values)
-
-
Method Detail
-
putOrUpdate
public void putOrUpdate(WeightedWord newWord)
-
toQueryString
public String toQueryString()
builds a query like(a OR "aa"^0.8 OR "aaa"^0.7)
using the related words. Related words are always quoted to prevent analysis.- Specified by:
toQueryStringin interfaceQueryStringTerm- Returns:
- term in query-string-query format.
-
getWord
public String getWord()
- Specified by:
getWordin interfaceQueryStringTerm- Returns:
- the single original word without the additional noise.
-
-