Skip to content

fix msearch setup after ES fixed it's issue #2176

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

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -1049,12 +1049,13 @@ public MsearchRequest searchMsearchRequest(

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
) //
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1616,9 +1616,6 @@ public void shouldPassIndicesOptionsForGivenSearchScrollQuery() {
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() {

Expand All @@ -1641,13 +1638,9 @@ public void shouldReturnSameEntityForMultiSearch() {
}
}

@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();
Expand All @@ -1662,7 +1655,8 @@ public void shouldReturnDifferentEntityForMultiSearch() {
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();
Expand All @@ -1674,7 +1668,7 @@ public void shouldReturnDifferentEntityForMultiSearch() {
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
Expand Down Expand Up @@ -3070,9 +3064,6 @@ void searchShouldReturnSeqNoPrimaryTerm() {
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();
Expand Down