mirror of
https://github.com/spring-projects/spring-data-elasticsearch.git
synced 2025-06-30 07:42:35 +00:00
Fix msearch setup after ES fixed it's issue.
Original Pull Request #2176 Closes #2138
This commit is contained in:
parent
ac64a6a733
commit
97d0566e94
@ -1049,12 +1049,13 @@ class RequestConverter {
|
|||||||
|
|
||||||
mrb.searches(sb -> sb //
|
mrb.searches(sb -> sb //
|
||||||
.header(h -> h //
|
.header(h -> h //
|
||||||
.index(param.index.getIndexName()) //
|
.index(Arrays.asList(param.index.getIndexNames())) //
|
||||||
// todo #2156 add remaining flags for header
|
// todo #2156 add remaining flags for header
|
||||||
) //
|
) //
|
||||||
.body(bb -> bb //
|
.body(bb -> bb //
|
||||||
.query(getQuery(param.query, param.clazz))//
|
.query(getQuery(param.query, param.clazz))//
|
||||||
// todo #2138 seq_no_primary_term and version not available in client ES issue 161
|
.seqNoPrimaryTerm(persistentEntity.hasSeqNoPrimaryTermProperty())
|
||||||
|
.version(true)
|
||||||
// todo #2156 add remaining flags for body
|
// todo #2156 add remaining flags for body
|
||||||
) //
|
) //
|
||||||
);
|
);
|
||||||
|
@ -1616,9 +1616,6 @@ public abstract class ElasticsearchIntegrationTests implements NewElasticsearchC
|
|||||||
assertThat(entities.size()).isGreaterThanOrEqualTo(1);
|
assertThat(entities.size()).isGreaterThanOrEqualTo(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
@DisabledIf(value = "newElasticsearchClient",
|
|
||||||
disabledReason = "todo #2138 can't check response, open ES issue 161 that does not allow seqno")
|
|
||||||
// and version to be set in the request
|
|
||||||
@Test // DATAES-487
|
@Test // DATAES-487
|
||||||
public void shouldReturnSameEntityForMultiSearch() {
|
public void shouldReturnSameEntityForMultiSearch() {
|
||||||
|
|
||||||
@ -1641,13 +1638,9 @@ public abstract class ElasticsearchIntegrationTests implements NewElasticsearchC
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@DisabledIf(value = "newElasticsearchClient",
|
|
||||||
disabledReason = "todo #2138 can't check response, open ES issue 161 that does not allow seqno")
|
|
||||||
// and version to be set in the request
|
|
||||||
@Test // DATAES-487
|
@Test // DATAES-487
|
||||||
public void shouldReturnDifferentEntityForMultiSearch() {
|
public void shouldReturnDifferentEntityForMultiSearch() {
|
||||||
|
|
||||||
Class<Book> clazz = Book.class;
|
|
||||||
IndexOperations bookIndexOperations = operations.indexOps(Book.class);
|
IndexOperations bookIndexOperations = operations.indexOps(Book.class);
|
||||||
bookIndexOperations.delete();
|
bookIndexOperations.delete();
|
||||||
bookIndexOperations.createWithMapping();
|
bookIndexOperations.createWithMapping();
|
||||||
@ -1662,7 +1655,8 @@ public abstract class ElasticsearchIntegrationTests implements NewElasticsearchC
|
|||||||
queries.add(getTermQuery("message", "ab"));
|
queries.add(getTermQuery("message", "ab"));
|
||||||
queries.add(getTermQuery("description", "bc"));
|
queries.add(getTermQuery("description", "bc"));
|
||||||
|
|
||||||
List<SearchHits<?>> searchHitsList = operations.multiSearch(queries, Lists.newArrayList(SampleEntity.class, clazz),
|
List<SearchHits<?>> searchHitsList = operations.multiSearch(queries, Lists.newArrayList(SampleEntity.class,
|
||||||
|
Book.class),
|
||||||
IndexCoordinates.of(indexNameProvider.indexName(), bookIndex.getIndexName()));
|
IndexCoordinates.of(indexNameProvider.indexName(), bookIndex.getIndexName()));
|
||||||
|
|
||||||
bookIndexOperations.delete();
|
bookIndexOperations.delete();
|
||||||
@ -1674,7 +1668,7 @@ public abstract class ElasticsearchIntegrationTests implements NewElasticsearchC
|
|||||||
SearchHits<?> searchHits1 = searchHitsList.get(1);
|
SearchHits<?> searchHits1 = searchHitsList.get(1);
|
||||||
assertThat(searchHits1.getTotalHits()).isEqualTo(1L);
|
assertThat(searchHits1.getTotalHits()).isEqualTo(1L);
|
||||||
SearchHit<Book> searchHit1 = (SearchHit<Book>) searchHits1.getSearchHit(0);
|
SearchHit<Book> searchHit1 = (SearchHit<Book>) searchHits1.getSearchHit(0);
|
||||||
assertThat(searchHit1.getContent().getClass()).isEqualTo(clazz);
|
assertThat(searchHit1.getContent().getClass()).isEqualTo(Book.class);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@ -3070,9 +3064,6 @@ public abstract class ElasticsearchIntegrationTests implements NewElasticsearchC
|
|||||||
assertThatSeqNoPrimaryTermIsFilled(retrieved);
|
assertThatSeqNoPrimaryTermIsFilled(retrieved);
|
||||||
}
|
}
|
||||||
|
|
||||||
@DisabledIf(value = "newElasticsearchClient",
|
|
||||||
disabledReason = "todo #2138 can't check response, open ES issue 161 that does not allow seqno")
|
|
||||||
// and version to be set in the request
|
|
||||||
@Test // DATAES-799
|
@Test // DATAES-799
|
||||||
void multiSearchShouldReturnSeqNoPrimaryTerm() {
|
void multiSearchShouldReturnSeqNoPrimaryTerm() {
|
||||||
OptimisticEntity original = new OptimisticEntity();
|
OptimisticEntity original = new OptimisticEntity();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user