package it.cavallium.dbengine.database.indicizer; import it.cavallium.dbengine.client.CompositeSnapshot; import it.cavallium.dbengine.database.DatabaseMemoryMode; import it.cavallium.dbengine.database.LLScoreMode; import it.cavallium.dbengine.database.LLSearchResult; import it.cavallium.dbengine.database.LLSort; import it.cavallium.dbengine.lucene.serializer.Query; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; import reactor.util.function.Tuple2; @SuppressWarnings("unused") public interface LuceneIndicizerWriter { Mono add(T key, U value); default Mono addMulti(@NotNull Flux> values) { return values.flatMap(tuple -> this.add(tuple.getT1(), tuple.getT2())).then(); } Mono remove(T key); Mono update(T key, U value); default Mono updateMulti(@NotNull Flux> values) { return values.flatMap(tuple -> this.update(tuple.getT1(), tuple.getT2())).then(); } Mono clearIndex(); Mono moreLikeThis(@Nullable CompositeSnapshot snapshot, U mltDocumentValue, int limit); Mono search(@Nullable CompositeSnapshot snapshot, Query query, int limit, @Nullable LLSort sort, LLScoreMode scoreMode); Mono count(@Nullable CompositeSnapshot snapshot, Query query); Mono close(); Mono getKey(String key); DatabaseMemoryMode getMemoryMode(); }