Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update analyzers.py to fix deprecated ngram key #1074

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

taoteg
Copy link
Collaborator

@taoteg taoteg commented Mar 5, 2025

Overview

During portal setup, ES throws this warning:

/opt/pysetup/.venv/lib/python3.11/site-packages/elasticsearch/connection/base.py:200: ElasticsearchWarning: The [nGram] tokenizer name is deprecated and will be removed in a future version. Please change the tokenizer name to [ngram] instead.

The nGram key was deprecated in ES v8.17, Es uses ngram now.

Related

  • No ticket, hot fix.

Changes

  • Change nGram to ngram in analyzers.py.

Testing

  1. Run the ES config setup_files_index(force=True) method in a deployed cms container and ensure there is no error.

UI

  • none.

Notes

During portal setup, ES throws this warning: `/opt/pysetup/.venv/lib/python3.11/site-packages/elasticsearch/connection/base.py:200: ElasticsearchWarning: The [nGram] tokenizer name is deprecated and will be removed in a future version. Please change the tokenizer name to [ngram] instead.`

The `nGram` key was deprecated in ES v8.17, now uses `ngram`.
Copy link

codecov bot commented Mar 5, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 70.34%. Comparing base (c210828) to head (935c890).

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##             main    #1074   +/-   ##
=======================================
  Coverage   70.34%   70.34%           
=======================================
  Files         538      538           
  Lines       33328    33328           
  Branches     2953     2953           
=======================================
  Hits        23446    23446           
  Misses       9684     9684           
  Partials      198      198           
Flag Coverage Δ
javascript 72.53% <ø> (ø)
unittests 61.00% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
server/portal/libs/elasticsearch/analyzers.py 100.00% <ø> (ø)
🚀 New features to boost your workflow:
  • Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants