Solr edismax wildcard search cannot find original string

I have the following content in my Solr index: west indian cherry in type text_en (see field definition below).

Search cherr* with cherr* found.
Also the cherri* search matches the words in the document.
But the search for cherry* does not match.

I suspect PorterStemFilterFactory for this, but I don't understand why (the query parser is the same as the index parser).


Request example

 /solr/select?defType=edismax&q=cherry* 

solrconfig.xml

 ... <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> ... 

field analysis

Index

 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 

request

 org.apache.solr.analysis.StandardTokenizerFactory: cherry org.apache.solr.analysis.LowerCaseFilterFactory: cherry org.apache.solr.analysis.EnglishPossessiveFilterFactory: cherry org.apache.solr.analysis.PorterStemFilterFactory: cherri 
+4
source share
1 answer

http://wiki.apache.org/solr/AnalyzersTokenizersTokenFilters#Analyzers mentions -

In wildcard and fuzzy searches, text analysis is not performed on the search word.

Thus, the search query will not be analyzed during the query. Consequently, indexed terms will differ from those that are being searched.

Since the indexed term is cherri , a search for cherry* will not match any documents.

+6
source

Source: https://habr.com/ru/post/1398023/


All Articles