Skip to content

Commit 42cfa30

Browse files
OAK-11736 fix failure for IndexQueryCommonTest.repSimilarAsNativeQuery (#2305)
* OAK-11736 fix failure for IndexQueryCommonTest.repSimilarAsNativeQuery * OAK-11736 revert changes in ElasticRequestHandler * OAK-11736 improved test * OAK-11736 re-enable test
1 parent 2526331 commit 42cfa30

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

oak-search/src/test/java/org/apache/jackrabbit/oak/plugins/index/IndexQueryCommonTest.java

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -394,7 +394,6 @@ public void testNativeLuceneQuery() throws Exception {
394394
}
395395

396396
@Test
397-
@Ignore("OAK-11736")
398397
public void repSimilarAsNativeQuery() throws Exception {
399398
String nativeQueryString = "select [jcr:path] from [nt:base] where " +
400399
"native('lucene', 'mlt?stream.body=/test/a&mlt.fl=:path&mlt.mindf=0&mlt.mintf=0')";
@@ -404,12 +403,14 @@ public void repSimilarAsNativeQuery() throws Exception {
404403
test.addChild("c").setProperty("text", "He said Hi.");
405404
root.commit();
406405
assertEventually(() -> {
407-
Iterator<String> result = executeQuery(nativeQueryString, Query.JCR_SQL2).iterator();
406+
Iterator<String> result = executeQuery(nativeQueryString, Query.JCR_SQL2, false, true).iterator();
408407
assertTrue(result.hasNext());
409408
assertEquals("/test/a", result.next());
410409
assertTrue(result.hasNext());
411410
assertEquals("/test/b", result.next());
412-
assertFalse(result.hasNext());
411+
while (result.hasNext()) {
412+
assertNotEquals("/test/c", result.next());
413+
}
413414
});
414415
assertNotEquals(0, logCustomizer.getLogs().size());
415416
assertTrue("native query WARN message is not present, message in Logger is "

0 commit comments

Comments
 (0)