Fix msearch setup after ES fixed it's issue.

Original Pull Request #2176
Closes #2138
This commit is contained in:
Peter-Josef Meisch 2022-06-01 14:48:46 +02:00 committed by GitHub
parent ac64a6a733
commit 97d0566e94
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 14 deletions

View File

@ -1049,12 +1049,13 @@ class RequestConverter {
mrb.searches(sb -> sb //
.header(h -> h //
.index(param.index.getIndexName()) //
.index(Arrays.asList(param.index.getIndexNames())) //
// todo #2156 add remaining flags for header
) //
.body(bb -> bb //
.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
) //
);

View File

@ -1616,9 +1616,6 @@ public abstract class ElasticsearchIntegrationTests implements NewElasticsearchC
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
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
public void shouldReturnDifferentEntityForMultiSearch() {
Class<Book> clazz = Book.class;
IndexOperations bookIndexOperations = operations.indexOps(Book.class);
bookIndexOperations.delete();
bookIndexOperations.createWithMapping();
@ -1662,7 +1655,8 @@ public abstract class ElasticsearchIntegrationTests implements NewElasticsearchC
queries.add(getTermQuery("message", "ab"));
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()));
bookIndexOperations.delete();
@ -1674,7 +1668,7 @@ public abstract class ElasticsearchIntegrationTests implements NewElasticsearchC
SearchHits<?> searchHits1 = searchHitsList.get(1);
assertThat(searchHits1.getTotalHits()).isEqualTo(1L);
SearchHit<Book> searchHit1 = (SearchHit<Book>) searchHits1.getSearchHit(0);
assertThat(searchHit1.getContent().getClass()).isEqualTo(clazz);
assertThat(searchHit1.getContent().getClass()).isEqualTo(Book.class);
}
@Test
@ -3070,9 +3064,6 @@ public abstract class ElasticsearchIntegrationTests implements NewElasticsearchC
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
void multiSearchShouldReturnSeqNoPrimaryTerm() {
OptimisticEntity original = new OptimisticEntity();