lucene-solr-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From TK Solr <tksol...@sonic.net>
Subject Re: ReversedWildcardFilter - should it be applied only at the index time?
Date Thu, 09 Apr 2020 01:26:42 GMT
I experimented with the index-time only use of ReversedWildcardFilter and the 
both time use.

My result shows using ReverseWildcardFilter both times runs twice as fast but my 
dataset is not very large (in the order of 10k docs), so I'm not sure if I can 
make a conclusion.

On 4/8/20 2:49 PM, TK Solr wrote:
> In the usage example shown in ReversedWildcardFilter 
> <https://lucene.apache.org/solr/guide/8_3/filter-descriptions.html#reversed-wildcard-filter>

> in Solr Ref Guide,
> and only usage find in managed-schema to define text_general_rev, the filter 
> is used only for indexing.
>
>   <fieldType name="text_general_rev" class="solr.TextField" 
> positionIncrementGap="100">
>     <analyzer type="index">
>       <tokenizer class="solr.StandardTokenizerFactory"/>
>       <filter class="solr.StopFilterFactory" words="stopwords.txt" 
> ignoreCase="true"/>
>       <filter class="solr.LowerCaseFilterFactory"/>
>       <filter class="solr.ReversedWildcardFilterFactory" maxPosQuestion="2" 
> maxFractionAsterisk="0.33" maxPosAsterisk="3" withOriginal="true"/>
>     </analyzer>
>     <analyzer type="query">
>       <tokenizer class="solr.StandardTokenizerFactory"/>
>       <filter class="solr.SynonymGraphFilterFactory" expand="true" 
> ignoreCase="true" synonyms="synonyms.txt"/>
>       <filter class="solr.StopFilterFactory" words="stopwords.txt" 
> ignoreCase="true"/>
>       <filter class="solr.LowerCaseFilterFactory"/>
>     </analyzer>
>   </fieldType>
>
>
> Is it incorrect to use the same analyzer for query like?
>
>   <fieldType name="lowercase_rev" class="solr.TextField" 
> positionIncrementGap="100">
>     <!-- Added to handle right-anchored substring match for email fields -->
>     <analyzer>
>       <tokenizer class="solr.WhitespaceTokenizerFactory"/>
>       <filter class="solr.LowerCaseFilterFactory"/>
>       <filter class="solr.ReversedWildcardFilterFactory" maxPosQuestion="0" 
> maxFractionAsterisk="0" maxPosAsterisk="100" withOriginal="false"/>
>     </analyzer>
>   </fieldType>
>
> In the description of filter, I see "Tokens without wildcards are not reversed."
> But the wildcard appears only in the query string. How can 
> ReversedWildcardFilter know if the wildcard is being used
> if the filter is used only at the indexing time?
>
> TK
>
>

Mime
View raw message