The synonym filter does set the "type" attribute to TYPE_SYNONYM for synonyms, so you could write your own token filter that "keeps" only tokens with that type.

Try the Solr Admin "analysis" page to see how various terms are analyzed by the synonym filter. It will show TYPE_SYNONYM.

-- Jack Krupansky

-----Original Message----- From: Daniel Rosher
Sent: Wednesday, October 10, 2012 8:34 AM
To: solr-user@lucene.apache.org
Subject: Synonym Filter: Removing all original tokens, retain matched synonyms

Hi,

Is there a way to do this?

Token_Input:
the fox jumped over the lazy dog

Synonym_Map:
fox => vulpes
dog => canine

Token_Output:
vulpes canine

So remove all tokens, but retain those matched against the synonym map

Cheers,
Dan

Reply via email to