You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Just been trying out a 1.5 snapshot (built from commit 75b6d8e from the 1.x branch) to request inner hits.
If your mapping has a 'nested' type and you specify your child document as an object rather than an array, you get a ClassCastException. I.e. your doc looks like this:
{
"nested_field": {
"make": "ford"
}
}
When searching you will get an exception like this:
java.lang.ClassCastException: java.util.LinkedHashMap cannot be cast to java.util.List
at org.elasticsearch.search.fetch.FetchPhase.createNestedSearchHit(FetchPhase.java:294)
at org.elasticsearch.search.fetch.FetchPhase.execute(FetchPhase.java:178)
at org.elasticsearch.search.fetch.innerhits.InnerHitsFetchSubPhase.hitExecute(InnerHitsFetchSubPhase.java:96)
at org.elasticsearch.search.fetch.FetchPhase.execute(FetchPhase.java:190)
at org.elasticsearch.search.SearchService.executeFetchPhase(SearchService.java:501)
Note that it works ok if you index your document like this (note the extra square brackets to indicate an array)
{
"nested_field": [
{
"make": "ford"
}
]
}
I think that either the nested hits stuff should support this single child using the non-array format, or elasticsearch should throw an error when you try to index a document using that syntax.
(note this issue came out of a comment on pull request #8153)
The text was updated successfully, but these errors were encountered:
Just been trying out a 1.5 snapshot (built from commit 75b6d8e from the 1.x branch) to request inner hits.
If your mapping has a 'nested' type and you specify your child document as an object rather than an array, you get a ClassCastException. I.e. your doc looks like this:
When searching you will get an exception like this:
Note that it works ok if you index your document like this (note the extra square brackets to indicate an array)
I think that either the nested hits stuff should support this single child using the non-array format, or elasticsearch should throw an error when you try to index a document using that syntax.
(note this issue came out of a comment on pull request #8153)
The text was updated successfully, but these errors were encountered: