Skip to content

Commit

Permalink
Make copy of ES6 settings before setting max_ngram_diff (#5625)
Browse files Browse the repository at this point in the history
  • Loading branch information
gasman authored and kaedroho committed Oct 16, 2019
1 parent ddbbaea commit fe9fcd5
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions wagtail/search/backends/elasticsearch7.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
from copy import deepcopy

from elasticsearch import NotFoundError
from elasticsearch.helpers import bulk

Expand Down Expand Up @@ -90,9 +92,8 @@ class Elasticsearch7SearchBackend(Elasticsearch6SearchBackend):
autocomplete_query_compiler_class = Elasticsearch7AutocompleteQueryCompiler
results_class = Elasticsearch7SearchResults

def __init__(self, params):
self.settings["settings"]["index"] = {"max_ngram_diff": 12}
super().__init__(params)
settings = deepcopy(Elasticsearch6SearchBackend.settings)
settings["settings"]["index"] = {"max_ngram_diff": 12}


SearchBackend = Elasticsearch7SearchBackend

0 comments on commit fe9fcd5

Please sign in to comment.