package it.cavallium.dbengine.database; 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 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, int limit, 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, String query, int limit, @Nullable LLSort sort, LLScoreMode scoreMode, String keyFieldName); default Mono count(@Nullable LLSnapshot snapshot, String queryString) { return this.search(snapshot, queryString, 0, null, null, null) .flatMap(LLSearchResult::totalHitsCount) .single(); } boolean isLowMemoryMode(); Mono close(); }