-
Notifications
You must be signed in to change notification settings - Fork 24.9k
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
More Like This Queries should error when Routing Set to "required" and no routing is supplied #29678
Comments
Pinging @elastic/es-search-aggs |
You should be able to add a |
Adding the routing field makes the query work as expected. Could an error be returned if you attempt to specify a document without a routing id if routing is set to required? Every other API I have used has given an appropriate error if I forget to set the routing id. |
Thats a good suggestion @kylelyk, I'm going to reword the title of this issue to reflect the intention to change to that behaviour and mark it as an adoptme |
Hello, Can I take up this issue? |
I'll have a look on this one. |
I can reproduce this issue on
Besides, Bulk API doesn't seem to allow
I'm now digging a little deeper in issue resolution and let you know. EDIT I've updated Gist test script to trigger a missing routing exception. Unlike the GET API, a |
I've opened a pull request to fix this issue, see #33974. |
Obsolete PR closed (due to bad Git rebase operation) and new one opened in sync with |
More like this query allows to provide identifiers of documents to be retrieved as like/unlike items. It can happen that at retrieval time an error is thrown, for instance caused by missing routing value when `_routing` is set required in the mapping. Instead of ignoring such error and returning no documents for the query, the error should be re-thrown and returned to users. As part of this change also mget and mtermvectors are unified in the way they throw such exception like it happens in other places, so that a `RoutingMissingException` is raised. Closes #29678
More like this query allows to provide identifiers of documents to be retrieved as like/unlike items. It can happen that at retrieval time an error is thrown, for instance caused by missing routing value when `_routing` is set required in the mapping. Instead of ignoring such error and returning no documents for the query, the error should be re-thrown and returned to users. As part of this change also mget and mtermvectors are unified in the way they throw such exception like it happens in other places, so that a `RoutingMissingException` is raised. Closes #29678
Elasticsearch version: 6.2.4
Plugins installed: []
JVM version: 1.8.0_101
OS version: MacOS (Darwin Kernel Version 15.6.0)
Description of the problem including expected versus actual behavior:
"More Like This" queries do not return any results when "mappings.type._routing" = true.
Steps to reproduce:
The following query returns no results:
If the _routing setting in the index mapping is removed, it correctly returns 1 result.
The text was updated successfully, but these errors were encountered: