-
Notifications
You must be signed in to change notification settings - Fork 25.2k
Prevent field API NPEs from token_count fields inside nested #69068
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
Conversation
Pinging @elastic/es-search (Team:Search) |
Currently when a `token_count` field is defined inside a nested field, we get an NPE because the underlying DocValueFetcher needs its formattedDocValues to be loaded and the SourceLookup it sees needs to have a valid docId other than -1. This change fixes those issues so the whole fields request doesn't error. However this change doesn't solve the missing support for doc values lookup under nested fields described in 68983. Fortunately `token_count` seems to be the only mapping type currently affected. Relates to elastic#68983
a5b6867
to
c961ae0
Compare
@elasticsearchmachine run elasticsearch-ci/2 |
Sorry @cbuescher for the failure, it's a rare but pervasive bug and a fix is incoming in #69102. @elasticmachine please run elasticsearch-ci/2 |
@elasticmachine update branch |
Ugh you're being really unlucky with that bug. The fix is now merged. |
rest-api-spec/src/main/resources/rest-api-spec/test/search/330_fetch_fields.yml
Outdated
Show resolved
Hide resolved
rest-api-spec/src/main/resources/rest-api-spec/test/search/330_fetch_fields.yml
Outdated
Show resolved
Hide resolved
rest-api-spec/src/main/resources/rest-api-spec/test/search/330_fetch_fields.yml
Outdated
Show resolved
Hide resolved
server/src/main/java/org/elasticsearch/index/mapper/NestedValueFetcher.java
Outdated
Show resolved
Hide resolved
@jtibshirani thanks for the review, I pushed the changes you suggested |
@elasticmachine update branch |
@elasticmachine run elasticsearch-ci/1 |
@@ -28,6 +29,7 @@ | |||
// the name of the nested field without the full path, i.e. in foo.bar.baz it would be baz | |||
private final String nestedFieldName; | |||
private final String[] nestedPathParts; | |||
private LeafReaderContext currentContext; |
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.
I don't think we need to track the context anymore.
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.
sure, leftover. I pushed an update
Currently when a `token_count` field is defined inside a nested field, we get an NPE because the underlying DocValueFetcher needs its formattedDocValues to be loaded and the SourceLookup it sees needs to have a valid docId other than -1. This change fixes those issues so the whole fields request doesn't error. However this change doesn't solve the missing support for doc values lookup under nested fields described in 68983. Fortunately `token_count` seems to be the only mapping type currently affected. Relates to #68983
Currently when a `token_count` field is defined inside a nested field, we get an NPE because the underlying DocValueFetcher needs its formattedDocValues to be loaded and the SourceLookup it sees needs to have a valid docId other than -1. This change fixes those issues so the whole fields request doesn't error. However this change doesn't solve the missing support for doc values lookup under nested fields described in 68983. Fortunately `token_count` seems to be the only mapping type currently affected. Relates to #68983
Currently when a
token_count
field is defined inside a nested field, we get anNPE because the underlying DocValueFetcher needs its formattedDocValues to be
loaded and the SourceLookup it sees needs to have a valid docId other than -1.
This change fixes those issues so the whole fields request doesn't error.
However this change doesn't solve the missing support for doc values lookup
under nested fields described in 68983. Fortunately
token_count
seems to be the onlymapping type currently affected.
Relates to #68983