package it.cavallium.dbengine.client; import io.net5.buffer.api.Send; import it.cavallium.dbengine.client.query.ClientQueryParams; import it.cavallium.dbengine.client.query.current.data.Query; import it.cavallium.dbengine.client.query.current.data.TotalHitsCount; import it.cavallium.dbengine.database.Delta; import it.cavallium.dbengine.database.LLSnapshottable; import it.cavallium.dbengine.database.collections.ValueGetter; import it.cavallium.dbengine.database.collections.ValueTransformer; import java.util.Map.Entry; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; public interface LuceneIndex extends LLSnapshottable { Mono addDocument(T key, U value); Mono addDocuments(Flux> entries); Mono deleteDocument(T key); Mono updateDocument(T key, @NotNull U value); Mono updateDocuments(Flux> entries); default Mono updateOrDeleteDocument(T key, @Nullable U value) { if (value == null) { return deleteDocument(key); } else { return updateDocument(key, value); } } default Mono updateOrDeleteDocumentIfModified(T key, @NotNull Delta delta) { return updateOrDeleteDocumentIfModified(key, delta.current(), delta.isModified()); } default Mono updateOrDeleteDocumentIfModified(T key, @Nullable U currentValue, boolean modified) { if (modified) { return updateOrDeleteDocument(key, currentValue); } else { return Mono.empty(); } } Mono deleteAll(); Mono>> moreLikeThis(ClientQueryParams queryParams, T key, U mltDocumentValue); Mono>> search(ClientQueryParams queryParams); Mono count(@Nullable CompositeSnapshot snapshot, Query query); boolean isLowMemoryMode(); Mono close(); Mono flush(); Mono refresh(boolean force); }