The Solr docs say:
solr.ReversedWildcardFilterFactory
A filter that reverses tokens to provide faster leading wildcard and prefix queries. Add this filter to the index analyzer, but not the query analyzer. The standard Solr query parser will use this to reverse wildcard and prefix queries to improve performance...
How does it do that though?
Since all the tokens run through the ReversedWildcardFilterFactory, does it store all the tokens in reverse? (That seems silly to me)
Or, does it store all the tokens normally and the reversed tokens and then run through an index list roughly twice as long when querying? (Presumably that's still much faster than searching using a leading *)
Part of why I'm confused is that in the example schema.xml
from Solr, they do the following:
<copyField source="*_en" dest="text_en_index"/>
<copyField source="*_en" dest="text_rev_index"/>
where text_rev_index
uses a ReversedWildcardFilterFactory
. If the ReversedWildcardFilterFactory
stores both the forward and reversed tokens, I'm not sure why they would copy these fields to both the forward and reversed dest
fields.