I have a product with name “Rotational”. Product name attribute is set to use standard_edge_ngram analyzer. But I am not getting result for all substring from rotational.
As far as I understand, customer should get that product as result if search query is one of these: “rot, rota, rotat, rotati, rotatio, rotation, rotationa, rotational“.
But specified product is shown as result only when customer is searching for: “rot, rota, rotat and rotational“. Why it doesnt work for “rotati, rotatio, rotation, rotationa“.
- min_gram is set to 3
- max_gram is set to 20
Down below is result from analyzer when checking it in backend, it is visible when keyword is “Rotational” that some tokens are missing but when keyword is “Rotationa” with missing “l” then it works fine.
It is fixed. The problem was in filter definition.
vendor/smile/elasticsuite/src/module-elasticsuite-core/etc/elasticsuite_analysis.xml
<analyzer name="standard_edge_ngram" tokenizer="standard" language="default">
<filters>
<filter ref="ascii_folding" />
<filter ref="trim" />
<filter ref="elision" />
<filter ref="word_delimiter" />
<filter ref="lowercase" />
<filter ref="stemmer_override" /> //should be removed
<filter ref="stemmer" /> //should be removed
<filter ref="edge_ngram_filter"/>
</filters>
<char_filters>
<char_filter ref="html_strip"/>
</char_filters>
</analyzer>
The problem was with stemmer which reduces a word to its root or base form.