Merged
Conversation
view/multi_match.js
Outdated
| // base view | ||
| var view = { multi_match: {} }; | ||
|
|
||
| properties.forEach(function(property) { |
Contributor
There was a problem hiding this comment.
what's the intent of this forEach? it seems to be doing nothing. was it meant to be a filter?
Closed
c426161 to
65804fa
Compare
Contributor
|
I'm a fan of this 👍 |
orangejulius
added a commit
that referenced
this pull request
Aug 26, 2020
BREAKING CHANGE: the old multi_match view is removed. I don't remembe writing it, but since #14 in early 2016(!) we have had a general purpose view for [multi_match](https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-multi-match-query.html) queries. This view doesn't fit our current pattern for keeping general purpose (i.e. corresponding to built in Elasticsear query) views in the `view/leaf` directory, and it doesn't support as much functionality as the `multi_match` view @Joxit made for us in #114 last year. This PR removes the older view, and in the process converts the `admin_multi_match` view over to using the new `multi_match` leaf query. While I don't think anything in the Pelias API uses the old `multi_match` query directly, this removal will require changes to the API tests because of minor differences in the final output.
orangejulius
added a commit
that referenced
this pull request
Aug 26, 2020
BREAKING CHANGE: the old multi_match view is removed. I don't remember writing it, but since #14 in early 2016(!) we have had a general purpose view for [multi_match](https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-multi-match-query.html) queries. This view doesn't fit our current pattern for keeping general purpose (i.e. corresponding to built in Elasticsearch query) views in the `view/leaf` directory, and it doesn't support as much functionality as the `multi_match` view @Joxit made for us in #114 last year. This PR removes the older view, and in the process converts the `admin_multi_match` view over to using the new `multi_match` leaf query. While I don't think anything in the Pelias API uses the old `multi_match` query directly, this removal will require changes to the API tests because of minor differences in the final output.
orangejulius
added a commit
that referenced
this pull request
Aug 26, 2020
BREAKING CHANGE: the old multi_match view is removed. I don't remember writing it, but since #14 in early 2016(!) we have had a general purpose view for [multi_match](https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-multi-match-query.html) queries. This view doesn't fit our current pattern for keeping general purpose (i.e. corresponding to built in Elasticsearch query) views in the `view/leaf` directory, and it doesn't support as much functionality as the `multi_match` view @Joxit made for us in #114 last year. This PR removes the older view, and in the process converts the `admin_multi_match` view over to using the new `multi_match` leaf query. While I don't think anything in the Pelias API uses the old `multi_match` query directly, this removal will require changes to the API tests because of minor differences in the final output.
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add a new generic template for multi_match queries, as well as a new admin_multi_match view specifically for querying multiple admin fields.
How admin_multi_match works
Our address parser currently looks at the
textfield in incoming API requests, and attempts to find admin fields in the text. It often finds things that are probably admin fields, but it doesn't know what level (country, city, state, etc). Previously, we would generate one match query for each possible admin field, which isn't ideal for a couple reasons:1.) It dilutes the value of any individual match, because Elasticsearch scoring makes keeps track of the number of match statements in a query, and lowers the score contribution of any individual match when there are more of them. A
multi_matchalways counts as only one.2.) It means the same admin value from the query text can match against multiple admin levels at the same time. We don't usually want this.