I have next content in my Solr index:
west indian cherry
in filed of type text_en
(see below for field definition).
When I search with cherr*
match is found.
Also search for cherri*
matches word in document.
But search for cherry*
does not match.
I suspect PorterStemFilterFactory
for this, but I don't understand why (query analyzer is same as index analyzer).
/solr/select?defType=edismax&q=cherry*
...
<fieldType name="text_en" class="solr.TextField" positionIncrementGap="100">
<analyzer type="index">
<tokenizer class="solr.StandardTokenizerFactory"/>
<filter class="solr.LowerCaseFilterFactory"/>
<filter class="solr.EnglishPossessiveFilterFactory"/>
<filter class="solr.PorterStemFilterFactory"/>
</analyzer>
<analyzer type="query">
<tokenizer class="solr.StandardTokenizerFactory"/>
<filter class="solr.LowerCaseFilterFactory"/>
<filter class="solr.EnglishPossessiveFilterFactory"/>
<filter class="solr.PorterStemFilterFactory"/>
</analyzer>
</fieldType>
...
org.apache.solr.analysis.StandardTokenizerFactory: cherry
org.apache.solr.analysis.LowerCaseFilterFactory: cherry
org.apache.solr.analysis.EnglishPossessiveFilterFactory: cherry
org.apache.solr.analysis.PorterStemFilterFactory: cherri <-- note the change from cherry to cherri
org.apache.solr.analysis.StandardTokenizerFactory: cherry
org.apache.solr.analysis.LowerCaseFilterFactory: cherry
org.apache.solr.analysis.EnglishPossessiveFilterFactory: cherry
org.apache.solr.analysis.PorterStemFilterFactory: cherri
http://wiki.apache.org/solr/AnalyzersTokenizersTokenFilters#Analyzers mentions -
On wildcard and fuzzy searches, no text analysis is performed on the search word.
So the search query will not undergo any analysis during query time. Hence the terms indexed would be different from the ones being search upon.
As the indexed term is cherri
, the search for cherry*
would not match any documents.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With