mirror of
https://github.com/spring-projects/spring-data-elasticsearch.git
synced 2025-07-05 18:22:23 +00:00
Fix retrieving data in Join-Type implementation.
Original Pull request #2900 Closes #2901
This commit is contained in:
parent
a16782ec73
commit
106b513d11
@ -52,7 +52,7 @@ public class Statement {
|
|||||||
return routing;
|
return routing;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setRouting(Routing routing) {
|
public void setRouting(String routing) {
|
||||||
this.routing = routing;
|
this.routing = routing;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -199,7 +199,7 @@ void init() {
|
|||||||
repository.save(
|
repository.save(
|
||||||
Statement.builder()
|
Statement.builder()
|
||||||
.withText("+1 for the sun")
|
.withText("+1 for the sun")
|
||||||
,withRouting(savedWeather.getId())
|
.withRouting(savedWeather.getId())
|
||||||
.withRelation(new JoinField<>("vote", sunnyAnswer.getId())) <5>
|
.withRelation(new JoinField<>("vote", sunnyAnswer.getId())) <5>
|
||||||
.build());
|
.build());
|
||||||
}
|
}
|
||||||
@ -226,6 +226,7 @@ SearchHits<Statement> hasVotes() {
|
|||||||
Query query = NativeQuery.builder()
|
Query query = NativeQuery.builder()
|
||||||
.withQuery(co.elastic.clients.elasticsearch._types.query_dsl.Query.of(qb -> qb
|
.withQuery(co.elastic.clients.elasticsearch._types.query_dsl.Query.of(qb -> qb
|
||||||
.hasChild(hc -> hc
|
.hasChild(hc -> hc
|
||||||
|
.type("answer")
|
||||||
.queryName("vote")
|
.queryName("vote")
|
||||||
.query(matchAllQueryAsQuery())
|
.query(matchAllQueryAsQuery())
|
||||||
.scoreMode(ChildScoreMode.None)
|
.scoreMode(ChildScoreMode.None)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user