More tests
This commit is contained in:
parent
f91617c7ec
commit
f6aab7dafb
@ -26,7 +26,6 @@ import it.cavallium.dbengine.database.collections.SubStageGetterMap;
|
||||
import it.cavallium.dbengine.database.disk.MemorySegmentUtils;
|
||||
import it.cavallium.dbengine.database.serialization.Serializer;
|
||||
import it.cavallium.dbengine.database.serialization.SerializerFixedBinaryLength;
|
||||
import it.cavallium.dbengine.lucene.StringIndicizer;
|
||||
import java.nio.file.Path;
|
||||
import java.util.Map;
|
||||
import java.util.Objects;
|
||||
@ -36,7 +35,6 @@ import org.jetbrains.annotations.Nullable;
|
||||
import org.reactivestreams.Publisher;
|
||||
import reactor.core.publisher.Flux;
|
||||
import reactor.core.publisher.Mono;
|
||||
import reactor.core.scheduler.Schedulers;
|
||||
|
||||
public class DbTestUtils {
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
package it.cavallium.dbengine.lucene;
|
||||
package it.cavallium.dbengine;
|
||||
|
||||
import com.google.common.primitives.Ints;
|
||||
import com.google.common.primitives.Longs;
|
@ -137,13 +137,16 @@ public class TestLuceneSearches {
|
||||
}
|
||||
|
||||
private static final Flux<Boolean> multi = Flux.just(false, true);
|
||||
private static final Flux<MultiSort<SearchResultKey<String>>> multiSort = Flux.just(MultiSort.topScore(),
|
||||
private static final Flux<MultiSort<SearchResultKey<String>>> multiSort = Flux.just(
|
||||
MultiSort.topScore(),
|
||||
//todo: fix random sort field
|
||||
//MultiSort.randomSortField(),
|
||||
MultiSort.noSort(),
|
||||
MultiSort.docSort(),
|
||||
MultiSort.numericSort("longsort", false),
|
||||
MultiSort.numericSort("longsort", true)
|
||||
MultiSort.numericSort("longsort", true),
|
||||
MultiSort.numericSort("intsort", false),
|
||||
MultiSort.numericSort("intsort", true)
|
||||
);
|
||||
|
||||
private static Flux<LocalSearcher> getSearchers(ExpectedQueryType info) {
|
||||
@ -283,7 +286,7 @@ public class TestLuceneSearches {
|
||||
}
|
||||
|
||||
Assertions.assertEquals(officialKeys.size(), keys.size());
|
||||
|
||||
|
||||
assertResults(officialKeys, keys, expectedQueryType.sorted(), expectedQueryType.sortedByScore());
|
||||
}
|
||||
}
|
||||
@ -293,11 +296,12 @@ public class TestLuceneSearches {
|
||||
@ParameterizedTest
|
||||
@MethodSource("provideQueryArgumentsScoreModeAndSort")
|
||||
public void testSearchNoDocs(boolean shards, MultiSort<SearchResultKey<String>> multiSort) throws Throwable {
|
||||
ClientQueryParamsBuilder<SearchResultKey<String>> queryBuilder = ClientQueryParams.builder();
|
||||
queryBuilder.query(new MatchNoDocsQuery());
|
||||
queryBuilder.snapshot(null);
|
||||
queryBuilder.complete(true);
|
||||
queryBuilder.sort(multiSort);
|
||||
var queryBuilder = ClientQueryParams
|
||||
.<SearchResultKey<String>>builder()
|
||||
.query(new MatchNoDocsQuery())
|
||||
.snapshot(null)
|
||||
.complete(true)
|
||||
.sort(multiSort);
|
||||
|
||||
ExpectedQueryType expectedQueryType = new ExpectedQueryType(shards, multiSort, true, false);
|
||||
testSearch(queryBuilder, expectedQueryType);
|
||||
@ -306,11 +310,12 @@ public class TestLuceneSearches {
|
||||
@ParameterizedTest
|
||||
@MethodSource("provideQueryArgumentsScoreModeAndSort")
|
||||
public void testSearchAllDocs(boolean shards, MultiSort<SearchResultKey<String>> multiSort) throws Throwable {
|
||||
ClientQueryParamsBuilder<SearchResultKey<String>> queryBuilder = ClientQueryParams.builder();
|
||||
queryBuilder.query(new MatchAllDocsQuery());
|
||||
queryBuilder.snapshot(null);
|
||||
queryBuilder.complete(true);
|
||||
queryBuilder.sort(multiSort);
|
||||
var queryBuilder = ClientQueryParams
|
||||
.<SearchResultKey<String>>builder()
|
||||
.query(new MatchAllDocsQuery())
|
||||
.snapshot(null)
|
||||
.complete(true)
|
||||
.sort(multiSort);
|
||||
|
||||
ExpectedQueryType expectedQueryType = new ExpectedQueryType(shards, multiSort, true, false);
|
||||
testSearch(queryBuilder, expectedQueryType);
|
||||
|
Loading…
Reference in New Issue
Block a user