package it.cavallium.dbengine.database; import it.cavallium.dbengine.lucene.serializer.Query; import java.util.Set; import org.jetbrains.annotations.Nullable; import reactor.core.publisher.Flux; import reactor.core.publisher.GroupedFlux; import reactor.core.publisher.Mono; import reactor.util.function.Tuple2; public interface LLLuceneIndex extends LLSnapshottable { String getLuceneIndexName(); Mono addDocument(LLTerm id, LLDocument doc); Mono addDocuments(Flux> documents); Mono deleteDocument(LLTerm id); Mono updateDocument(LLTerm id, LLDocument document); Mono updateDocuments(Flux> documents); Mono deleteAll(); /** * @param additionalQuery An additional query that will be used with the moreLikeThis query: "mltQuery AND additionalQuery" * @param limit the limit is valid for each lucene instance. * If you have 15 instances, the number of elements returned * can be at most limit * 15 * @return the collection has one or more flux */ Mono moreLikeThis(@Nullable LLSnapshot snapshot, Flux>> mltDocumentFields, @Nullable it.cavallium.dbengine.lucene.serializer.Query additionalQuery, long limit, @Nullable Float minCompetitiveScore, boolean enableScoring, boolean sortByScore, String keyFieldName); /** * * @param limit the limit is valid for each lucene instance. * If you have 15 instances, the number of elements returned * can be at most limit * 15 * @return the collection has one or more flux */ Mono search(@Nullable LLSnapshot snapshot, Query query, long limit, @Nullable LLSort sort, LLScoreMode scoreMode, @Nullable Float minCompetitiveScore, String keyFieldName); default Mono count(@Nullable LLSnapshot snapshot, Query query) { return this.search(snapshot, query, 0, null, null, null, null) .flatMap(LLSearchResult::totalHitsCount) .single(); } boolean isLowMemoryMode(); Mono close(); /** * Flush writes to disk */ Mono flush(); /** * Refresh index searcher */ Mono refresh(); }