I am writing a custom text field type for my SKU products.
If I have an SKU, for example ABC-DEF123G/5(just an example), I want users to be able to search with or without punctuation. In many cases, only part of the SKU is important, for example. ABC-DEF123in my example.
So far I have schema.xml:
<fieldType name="sku" class="solr.TextField" omitNorms="false">
<analyzer>
<tokenizer class="solr.KeywordTokenizerFactory"/>
<filter class="solr.LowerCaseFilterFactory"/>
<filter class="solr.WordDelimiterFilterFactory"
splitOnCaseChange="0"
splitOnNumerics="0"
stemEnglishPossessive="0"
catenateAll="1"
/>
<filter class="solr.EdgeNGramFilterFactory" minGramSize="3" maxGramSize="15"/>
</analyzer>
</fieldType>
<dynamicField name="*_sku" stored="false" type="sku" multiValued="true" indexed="true"/>
This works well in that I can search for SKU parts, for example. DEF123and get the corresponding result (thanks to the ngram filter). However, a search without punctuation delimiters does not return any matches: ABC-DEF123G/5excellent, but ABCDEF123G5not.
When I do an analysis of my schema, I see that the search ABCDEF123G5highlighted matches, but when I run a real query, the results do not return.
Solr . .
SKU ?
(aitchnyu) :
SKU - , .
, . SKU , , , . . SKU , , , , , . SKU . , Guitar Hero 3 SKU, - .