We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
sothawo opened DATAES-939 and commented
Currently NativeSearchQuery supports a collapse field by accepting a String. This should be extended to also allow to define inner_hits and other parameters (https://www.elastic.co/guide/en/elasticsearch/reference/7.9/collapse-search-results.html#expand-collapse-results)
Reference URL: https://stackoverflow.com/questions/64106687/spring-data-elasticsearch-is-inner-hit-supported-at-root-level-on-query
The text was updated successfully, but these errors were encountered:
Hi, is there any workaround to get inner hits with collapse field for now?
Sorry, something went wrong.
NO, this is still an open issue.
I did the workaround. I'm using JestElasticsearchTemplate as client and I copied NativeQueryBuilder with an extra method:
public ExtendedNativeQueryBuilder withCollapse(CollapseBuilder collapseBuilder){ this.collapseBuilder = collapseBuilder; return this; }
and using the client with the new method.
((JestElasticsearchTemplate) elasticsearchTemplate).query(new ExtendedNativeQueryBuilder() .withIndices("indice").withFilter(QueryBuilders.matchAllQuery()) .withCollapse(new CollapseBuilder("collapse_field").setInnerHits(new InnerHitBuilder("inner_hit_name"))) .build(), extractor);
as a query result, I'm able to retrieve innert_hits inside the JSON object.
Successfully merging a pull request may close this issue.
sothawo opened DATAES-939 and commented
Currently NativeSearchQuery supports a collapse field by accepting a String. This should be extended to also allow to define inner_hits and other parameters (https://www.elastic.co/guide/en/elasticsearch/reference/7.9/collapse-search-results.html#expand-collapse-results)
Reference URL: https://stackoverflow.com/questions/64106687/spring-data-elasticsearch-is-inner-hit-supported-at-root-level-on-query
The text was updated successfully, but these errors were encountered: