Shingle TokenFilter error in Elastic Search

2.7k Views Asked by At

I have installed smile elastic suite module on my Magento 2 installation and I'm getting this error,

I'm running MAMP and elastic search 7.0.1 with Magento 2.3.0

[
    {
        "type": "illegal_argument_exception",
        "reason": "In Shingle TokenFilter the difference between max_shingle_size and min_shingle_size (and +1 if outputting unigrams) must be less than or equal to: [3] but was [9]. This limit can be set by changing the [index.max_shingle_diff] index level setting."
    }
]
1

There are 1 best solutions below

1
Pierre Mallet On

Its explained in the documentation :

shingle token filter and index settings reference

The index level setting index.max_shingle_diff controls the maximum allowed difference between max_shingle_size and min_shingle_size.

So if your want to allow a diff greater than 3 you have to update the max_shingle_diff in your index settings through the update setting API or at index creation.

The default value of 3 is a conservative value to avoid index explosion :)

example :

PUT /<yourindex>/_settings
{
    "index" : {
        "max_shingle_diff" : 10
    }
}