Is there an existing TokenFilterFactory that can conditionally insert synonyms based on a given document attribute, say category? Some synonyms only make sense in context: "bats" in Sports is different from "bats" in "Party and Novelty".

It seems the synonyms.txt file would need an additional column that could be checked against the document attribute prior to appending synonyms:

*#synonyms            category*
post,pole                sports
wheel,caster           furniture
pat,paddy,patrick   holiday

Is anything like this possible without writing a custom TokenFilterFactory?

Reply via email to