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

innerHits highlight issue with _source disabled #66524

Closed
rgoene opened this issue Dec 17, 2020 · 3 comments · Fixed by #66572
Closed

innerHits highlight issue with _source disabled #66524

rgoene opened this issue Dec 17, 2020 · 3 comments · Fixed by #66572
Assignees
Labels
>bug >regression :Search/Mapping Index mappings, including merging and defining field types Team:Search Meta label for search team

Comments

@rgoene
Copy link

rgoene commented Dec 17, 2020

*Elasticsearch version : 7.10.1

Plugins installed: none

JVM version : embedded jvm

*OS version: Darwin Kernel Version 19.6.0, 8.04.1-Ubuntu SMP

Description of the problem including expected versus actual behavior:

A text field with indexed offsets in a nested document produces an error when querying with highlights. We use stored fields and not the _source.

  • This worked properly with 7.9.3.
  • This issue does not occur with non-nested fields.
  • Disabling the _source field in the mapping is relevant for the issue.

The following error occurs:
"type": "illegal_state_exception",
"reason": "extracted source isn't an object or an array"

There is only one place in the src where this message is thrown:
https://github.com/elastic/elasticsearch/blob/master/server/src/main/java/org/elasticsearch/search/fetch/FetchPhase.java

This recent work seems to be relevant: #65292

Steps to reproduce:

curl -X DELETE "http://localhost:9200/bugtest"

curl -X PUT "http://localhost:9200/bugtest/" -d '{ "mappings": { "_source": { "enabled": false }, "properties": { "text": { "type": "text", "store": true, "index_options": "offsets" }, "page": { "type": "nested", "properties": { "text": { "type": "text", "store": true, "index_options": "offsets" } } } } } }' -H 'Content-Type: application/json'

curl -X PUT "http://localhost:9200/bugtest/_doc/testdoc" -d '{ "text": "test text with nothing else than a simple test", "page": [ {"text": "test text with nothing else than a simple test"}, {"text": "test two"} ] }' -H 'Content-Type: application/json'

curl -X POST "http://localhost:9200/bugtest/_search" -d '{ "query": { "nested": { "path": "page", "query": { "match": {"page.text" : "test"} }, "inner_hits": { "stored_fields": ["page.text"], "highlight" : { "fields" : { "page.text": {"type": "unified"} } } } } } } ' -H 'Content-Type: application/json'

@rgoene rgoene added >bug needs:triage Requires assignment of a team area label labels Dec 17, 2020
@jimczi jimczi added :Search/Mapping Index mappings, including merging and defining field types and removed needs:triage Requires assignment of a team area label labels Dec 17, 2020
@elasticmachine elasticmachine added the Team:Search Meta label for search team label Dec 17, 2020
@elasticmachine
Copy link
Collaborator

Pinging @elastic/es-search (Team:Search)

@jtibshirani
Copy link
Contributor

Thanks a lot @rgoene for reporting this, we had some unfortunate regressions around nested hits in 7.10. The fix will be available in the upcoming 7.10.2 and 7.11 releases.

@rgoene
Copy link
Author

rgoene commented Dec 21, 2020

Thanks for the quick response @jtibshirani !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
>bug >regression :Search/Mapping Index mappings, including merging and defining field types Team:Search Meta label for search team
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants