Add a new field to set 'max_ngram_diff' settings and sync it with Elasticsearch index

Created on 19 September 2019, about 5 years ago
Updated 3 December 2024, about 21 hours ago

Hello,
I had to enhance a project which works with ElasticSearch 7.3 (ES).

I found a problem with autocomplete when I used ngram on fulltext fields.

ES have a parameter called 'max_ngram_diff' which define the maximum difference between min_ngram and max_ngram.
But the default value is 1 and can't be changed throught Drupal. So, it's actually impossible to define for example min_gram = 3 and max_gram = 10 to say to the tokenizer to split more efficiantly.

I have added a new field into "Ngram configuration" tab, on "edit index" form to do that. After setting this new field, the parameter max_ngram_diff is passed to index configuration on ES server.

This way, autocomplete's results are more pertinents.

I propose a patch to enhance ngram configuration directly on Drupal.

Thanks !

Feature request
Status

RTBC

Version

1.0

Component

Code

Created by

🇫🇷France Striknin Lyon

Live updates comments and jobs are added and updated live.
  • Needs tests

    The change is currently missing an automated test that fails when run with the original code, and succeeds when the bug has been fixed.

Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • 🇳🇱Netherlands ralphvdhoudt

    Path #7 added the schema, only extending the search_api.index.* schema did not work correctly

    Updated the config schema to work with third_party_settings with their own config

Production build 0.71.5 2024