From 30c44747b19fa7f2b8c7ea1e5ffb902af96498bc Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Tue, 20 Aug 2024 10:21:22 +0100 Subject: [PATCH] Removed unused analyzer from search as you type example (#1883) (#1886) (cherry picked from commit b762aaecfb12c607acc508cae8f9ae4d06cb1e7b) Co-authored-by: Miguel Grinberg --- examples/async/search_as_you_type.py | 10 ---------- examples/search_as_you_type.py | 17 +---------------- 2 files changed, 1 insertion(+), 26 deletions(-) diff --git a/examples/async/search_as_you_type.py b/examples/async/search_as_you_type.py index 67830b20..2a069bea 100644 --- a/examples/async/search_as_you_type.py +++ b/examples/async/search_as_you_type.py @@ -32,21 +32,11 @@ from elasticsearch_dsl import ( AsyncDocument, SearchAsYouType, - analyzer, async_connections, mapped_field, - token_filter, ) from elasticsearch_dsl.query import MultiMatch -# custom analyzer for names -ascii_fold = analyzer( - "ascii_fold", - # we don't want to split O'Brian or Toulouse-Lautrec - tokenizer="whitespace", - filter=["lowercase", token_filter("ascii_fold", "asciifolding")], -) - class Person(AsyncDocument): if TYPE_CHECKING: diff --git a/examples/search_as_you_type.py b/examples/search_as_you_type.py index e22b11da..f319b6eb 100644 --- a/examples/search_as_you_type.py +++ b/examples/search_as_you_type.py @@ -28,24 +28,9 @@ import os from typing import TYPE_CHECKING, Optional -from elasticsearch_dsl import ( - Document, - SearchAsYouType, - analyzer, - connections, - mapped_field, - token_filter, -) +from elasticsearch_dsl import Document, SearchAsYouType, connections, mapped_field from elasticsearch_dsl.query import MultiMatch -# custom analyzer for names -ascii_fold = analyzer( - "ascii_fold", - # we don't want to split O'Brian or Toulouse-Lautrec - tokenizer="whitespace", - filter=["lowercase", token_filter("ascii_fold", "asciifolding")], -) - class Person(Document): if TYPE_CHECKING: