Skip to content
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 1 commit into from
Apr 21, 2016
Merged

Multi match admin parts #14

merged 1 commit into from
Apr 21, 2016

Conversation

orangejulius
Copy link
Member

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.

@orangejulius orangejulius self-assigned this Apr 4, 2016
@orangejulius orangejulius added this to the Who's on First milestone Apr 4, 2016
// base view
var view = { multi_match: {} };

properties.forEach(function(property) {
Copy link
Contributor

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?

@dianashk dianashk mentioned this pull request Apr 5, 2016
@dianashk
Copy link
Contributor

I'm a fan of this 👍

@orangejulius orangejulius merged commit a61feb6 into master Apr 21, 2016
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
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants