lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Alan Woodward <>
Subject Preserving TokenFilters
Date Mon, 12 Mar 2012 16:47:10 GMT

I have a number of operations that I want to apply to a TokenStream, supplementing the original
tokens with modified forms.  For example, I want to reverse tokens, to allow prefix wildcard
queries, and I want to index both lowercased and original terms.

I initially tried to wrap ReverseStringFilter and LowerCaseFilter with a generic 'preserve
original token' filter, but this doesn't work, as TokenFilter chaining works by pulling tokens
from parents, and I somehow need to push them into children.  So I tried subclassing the filters
instead, but of course they're both final…

Is there already some way of doing this that I'm missing?  Or will I just have to copy'n'paste
RSFilter and LCFilter to my own package, and add the preserving logic myself?

(I'm aware that there's a Solr filter, ReversedWildcardFilter, that will do part of this for
me, but I was hoping to only use lucene classes).


Alan Woodward
To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message