I have a little problem with my Solr search engine. It does not return any result when I search on the word “suits”. I’m 100% sure that it exists a document that are containing the word “Suits”. I can however search for the word “suit” and the result containing “suits” ends up.
My schema:
<schema name="hello" version="1.3">
<types>
<fieldType name="string" class="solr.StrField" sortMissingLast="true" omitNorms="true"/>
<fieldType name="text" class="solr.TextField" positionIncrementGap="100" autoGeneratePhraseQueries="true">
<analyzer type="index">
<tokenizer class="solr.WhitespaceTokenizerFactory"/>
<filter class="solr.WordDelimiterFilterFactory" generateWordParts="1" generateNumberParts="1" catenateWords="1" catenateNumbers="1" catenateAll="0" splitOnCaseChange="1"/>
<filter class="solr.LowerCaseFilterFactory"/>
<filter class="solr.KeywordMarkerFilterFactory" protected="protwords.txt"/>
<filter class="solr.PorterStemFilterFactory"/>
</analyzer>
<analyzer type="query">
<tokenizer class="solr.WhitespaceTokenizerFactory"/>
<filter class="solr.SynonymFilterFactory" synonyms="synonyms.txt" ignoreCase="true" expand="true"/>
<filter class="solr.WordDelimiterFilterFactory" generateWordParts="1" generateNumberParts="1" catenateWords="0" catenateNumbers="0" catenateAll="0" splitOnCaseChange="1"/>
<filter class="solr.LowerCaseFilterFactory"/>
<filter class="solr.KeywordMarkerFilterFactory" protected="protwords.txt"/>
<filter class="solr.PorterStemFilterFactory"/>
</analyzer>
</fieldType>
</types>
<fields>
<field name="id" type="string" indexed="true" stored="true" required="true" />
<field name="title" type="text" indexed="true" stored="true" required="true"/>
<field name="description" type="text" indexed="true" stored="true" required="true"/>
<field name="profileMiniature" type="string" stored="true" required="true"/>
</fields>
<uniqueKey>id</uniqueKey>
<defaultSearchField>title</defaultSearchField>
</schema>
my query is "title:$q*^2 description:$q*".
A search with wildcards disables the analysis (as described here).
To match
suitwithsuits, you need stemming and not wildcards. Using wildcards will anyway not work if your data hassuitand the query issuits.Could you provide some more information – maybe a use-case which explains why you need wildcards? It will help us come up with a better solution to your problem.