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

DATAES-263 inner hits fetch support #149

Open
wants to merge 1 commit into
base: master
from

Conversation

Projects
None yet
4 participants
@flefebure
Copy link

commented Jun 14, 2016

Hi,
This pull request in linked with Jira https://jira.spring.io/browse/DATAES-263
The purpose of this PR is to enhance ES inner hits support in Spring Data ES repositories

You can annotate a property with the @InnerHits annotation :

@InnerHits(path = "books")
private List<Book> targetedBooks;
@InnerHits(path = "parent-entity")
private ParentEntity parent;
@InnerHits(path = "child-entity")
private List<ChildEntity> children;

For parent/child relations, path must match the relative parent or child mapping type
For nested objects, path must match the query nested collection name

Regarding the collections, only Set<> and List<> are supported.

To populate the annotated relations, the queries must include an innerHits structure
eg for a nested :

QueryBuilder query = nestedQuery("books", QueryBuilders.termQuery("books.name", "testbook1")).innerHit(new QueryInnerHitBuilder());
List<Person> persons = elasticsearchTemplate.queryForList(new NativeSearchQuery(query), Person.class);

Check testU here : ElasticsearchTemplateInnerHitsTests.java

Franck

@flefebure flefebure changed the title inner hits fetch support [DATAES-263] inner hits fetch support Jun 14, 2016

@flefebure flefebure changed the title [DATAES-263] inner hits fetch support DATAES-263 inner hits fetch support Jun 14, 2016

@odrotbohm odrotbohm force-pushed the spring-projects:master branch from f2b20bc to 896fbbe Sep 1, 2016

@odrotbohm odrotbohm force-pushed the spring-projects:master branch from 21b937f to 7f995b3 Mar 30, 2017

@vbabenko

This comment has been minimized.

Copy link

commented Nov 23, 2017

Are conflicts going to be resolved and merged? That feature looks really helpful. Thank you for your work.

@odrotbohm odrotbohm force-pushed the spring-projects:master branch from 020b5e1 to ba3eba5 Jun 18, 2018

@mp911de mp911de force-pushed the spring-projects:master branch from 01cda35 to b6fa4c8 May 6, 2019

@pivotal-issuemaster

This comment has been minimized.

Copy link

commented Jun 4, 2019

@flefebure Please sign the Contributor License Agreement!

Click here to manually synchronize the status of this Pull Request.

See the FAQ for frequently asked questions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.