-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Search: use multi-fields for Wildcard queries (#7613)
Wildcard queries are slow (on .org it returns 502, on .com since the db is small it works just fine). https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl.html#query-dsl-allow-expensive-queries These type of queries can be optimized by using the Wildcard field https://www.elastic.co/guide/en/elasticsearch/reference/current/keyword.html#wildcard-field-type. Currently that field isn't implemented in the ES dependencies, but is just a subclass of the Keyword field (I'll see if I can send a PR upstream). As we still want to make use of the SimpleString queries, I'm using the multi-fields feature. This change is editing the index, so we need to rebuild the index and re-index. To test it locally: - `inv docker.manage 'search_index --rebuild'`. - `inv docker.manage reindex_elasticsearch`. - Enable the `DEFAULT_TO_FUZZY_SEARCH` feature flag on a project. I'm not sure how to write tests for this one, and we can't test if this is really fast in production... But testing it locally works and gives better results for both, sections and domains!
- Loading branch information
Showing
4 changed files
with
136 additions
and
38 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters