-
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
use cross_fields type for multi_match #116
base: master
Are you sure you want to change the base?
Conversation
This issue is covered by a failing test case which indicates that the text length possibly has something to do with how the
|
I added a second commit to disable Below is a minimal test-case which shows that removing @orangejulius any idea what's going on here? I read the docs for I'm assuming it's something to do with mixing {
"query": {
"bool": {
"must": [
{
"match": {
"name.default": {
"analyzer": "peliasQuery",
"query": "Target",
"cutoff_frequency": 0.01
}
}
},
{
"multi_match": {
"fields": [
"parent.country^1",
"parent.region^1",
"parent.county^1",
"parent.localadmin^1",
"parent.locality^1",
"parent.borough^1",
"parent.neighbourhood^1",
"parent.region_a^1"
],
"type": "cross_fields",
"query": "Eureka California",
"analyzer": "peliasAdmin",
"cutoff_frequency": 0.01
}
}
]
}
},
"size": 20
} |
I tested this PR on our staging environment and it caused 0 regressions and 1 improvement: ✔ improvement [searchpoi-2] "/v1/search?text=Target Eureka California" |
I noticed a bug today where which causes
admin_multi_match
queries to score results incorrectly for multi-term admin queries.I'll attach a simple test-case below, prior to this PR we were using the default
best_fields
type which would essentially ignore the "Eureka" part of the query, meaning that the results were returned in the wrong order:By changing this to
cross_fields
we are able to use the combined score across all fields, which in-turn scores the query correctly, returning the "Eureka" result first.