Skip to content

Field Collapsing: Version is not visible for inner_hits #27822

@KarstenRauch

Description

@KarstenRauch

Elasticsearch version: 6.1 and below

Steps to reproduce:

Search with the example
https://www.elastic.co/guide/en/elasticsearch/reference/current/search-request-collapse.html#_expand_collapse_results
but set
"inner_hits":{ "version":true, ... }
Expected:
In the result "hits" below "inner_hits" is a field "_version".
Instead the result is the same as for "version":false,.

Test-Case:
InnerHitsCollapseIT.java.txt

Solution:

Add one extra line 168 in /_core/java/org/elasticsearch/action/search/ExpandSearchPhase.java
(Method org.elasticsearch.action.search.ExpandSearchPhase.buildExpandSearchSourceBuilder(InnerHitBuilder) ):
groupSource.version(options.isVersion());

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions