I was trying to use a shingles filter to generate combination of words before using the synonyms filter. But thats not working. Can you suggest an alternate solution for the below scenario?
(I already have a phrase list filter which takes a predefined list of phrases from a file but that doesn't cover all the phrases. Wanted a more dynamic solution)
Synonyms
"heart attack", "cardiac arrest"
Input text
"Symptoms of heart attack"
"heart", "attack", "cardiac" and "arrest" should not get mapped their respective synonyms individually, instead only the combination of "heart attack" should get mapped to "cardiac arrest
"
Thanks @RabBit_BR for the response. I tried this approach, won't this create invalid (contextually) combinations? For eg. In the above case, if "heart" is mapped to its synonyms and "attack" mapped to its own set of synonyms, and using synonyms filter before shingle will output contextually invalid combinations. Am I wrong in this observation?
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.