-
Notifications
You must be signed in to change notification settings - Fork 26
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Multi match admin parts #14
Merged
Merged
Conversation
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
// base view | ||
var view = { multi_match: {} }; | ||
|
||
properties.forEach(function(property) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what's the intent of this forEach
? it seems to be doing nothing. was it meant to be a filter
?
Closed
orangejulius
force-pushed
the
multi_match_admin_parts
branch
from
April 6, 2016 18:56
c426161
to
65804fa
Compare
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.
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
text
field 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_match
always 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.