Skip to content

Commit b762aae

Browse files
Removed unused analyzer from search as you type example (#1883)
1 parent aa434c9 commit b762aae

File tree

2 files changed

+1
-26
lines changed

2 files changed

+1
-26
lines changed

examples/async/search_as_you_type.py

-10
Original file line numberDiff line numberDiff line change
@@ -32,21 +32,11 @@
3232
from elasticsearch_dsl import (
3333
AsyncDocument,
3434
SearchAsYouType,
35-
analyzer,
3635
async_connections,
3736
mapped_field,
38-
token_filter,
3937
)
4038
from elasticsearch_dsl.query import MultiMatch
4139

42-
# custom analyzer for names
43-
ascii_fold = analyzer(
44-
"ascii_fold",
45-
# we don't want to split O'Brian or Toulouse-Lautrec
46-
tokenizer="whitespace",
47-
filter=["lowercase", token_filter("ascii_fold", "asciifolding")],
48-
)
49-
5040

5141
class Person(AsyncDocument):
5242
if TYPE_CHECKING:

examples/search_as_you_type.py

+1-16
Original file line numberDiff line numberDiff line change
@@ -28,24 +28,9 @@
2828
import os
2929
from typing import TYPE_CHECKING, Optional
3030

31-
from elasticsearch_dsl import (
32-
Document,
33-
SearchAsYouType,
34-
analyzer,
35-
connections,
36-
mapped_field,
37-
token_filter,
38-
)
31+
from elasticsearch_dsl import Document, SearchAsYouType, connections, mapped_field
3932
from elasticsearch_dsl.query import MultiMatch
4033

41-
# custom analyzer for names
42-
ascii_fold = analyzer(
43-
"ascii_fold",
44-
# we don't want to split O'Brian or Toulouse-Lautrec
45-
tokenizer="whitespace",
46-
filter=["lowercase", token_filter("ascii_fold", "asciifolding")],
47-
)
48-
4934

5035
class Person(Document):
5136
if TYPE_CHECKING:

0 commit comments

Comments
 (0)