Skip to content

Commit

Permalink
Removed unused analyzer from search as you type example
Browse files Browse the repository at this point in the history
  • Loading branch information
miguelgrinberg committed Aug 19, 2024
1 parent 7fa4f8c commit e72c697
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 e72c697

Please sign in to comment.