Skip to content

Commit

Permalink
Removed unused analyzer from search as you type example (#1883) (#1886)
Browse files Browse the repository at this point in the history
(cherry picked from commit b762aae)

Co-authored-by: Miguel Grinberg <miguel.grinberg@gmail.com>
  • Loading branch information
github-actions[bot] and miguelgrinberg committed Aug 20, 2024
1 parent 575406a commit 30c4474
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 26 deletions.
10 changes: 0 additions & 10 deletions examples/async/search_as_you_type.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
17 changes: 1 addition & 16 deletions examples/search_as_you_type.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit 30c4474

Please sign in to comment.