I have a fieldType which is defined as below. Now, I have defined a field 'StatusCode' of this field type which holds a Single Character like A or P. I have indexed the data using this fieldType and when I run a query like StatusCode:A it does not return any results. Can someone please explain why the query is not working on Single character fields?
<fieldType name="text_exact_fuzzy" class="solr.TextField" omitNorms="false">
<analyzer type="index">
<tokenizer class="solr.StandardTokenizerFactory"/>
<filter class="solr.StandardFilterFactory"/>
<filter class="solr.LowerCaseFilterFactory"/>
</analyzer>
<analyzer type="query">
<tokenizer class="solr.StandardTokenizerFactory"/>
<filter class="solr.StandardFilterFactory"/>
<filter class="solr.LowerCaseFilterFactory"/>
</analyzer>
</fieldType>
It seems weird to define a field like StatusCode as text_exact_fuzzy and with those analyzers.
Use a simple StrField instead, without any analysis performed (only a lowercase filter factory if needed), and you should get the expected hits.
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