All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.fluxcapacitor.javaclient.persisting.search.client.SearchClient Maven / Gradle / Ivy

There is a newer version: 0.1015.0
Show newest version
/*
 * Copyright (c) Flux Capacitor IP B.V. or its affiliates. All Rights Reserved.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *     http://www.apache.org/licenses/LICENSE-2.0
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package io.fluxcapacitor.javaclient.persisting.search.client;

import io.fluxcapacitor.common.Guarantee;
import io.fluxcapacitor.common.api.search.CreateAuditTrail;
import io.fluxcapacitor.common.api.search.DocumentStats;
import io.fluxcapacitor.common.api.search.DocumentUpdate;
import io.fluxcapacitor.common.api.search.FacetStats;
import io.fluxcapacitor.common.api.search.GetDocument;
import io.fluxcapacitor.common.api.search.GetSearchHistogram;
import io.fluxcapacitor.common.api.search.SearchDocuments;
import io.fluxcapacitor.common.api.search.SearchHistogram;
import io.fluxcapacitor.common.api.search.SearchQuery;
import io.fluxcapacitor.common.api.search.SerializedDocument;
import io.fluxcapacitor.javaclient.persisting.search.SearchHit;

import java.util.Collection;
import java.util.List;
import java.util.Optional;
import java.util.concurrent.CompletableFuture;
import java.util.stream.Stream;

public interface SearchClient extends AutoCloseable {

    CompletableFuture index(List documents, Guarantee guarantee, boolean ifNotExists);

    Stream> search(SearchDocuments searchDocuments, int fetchSize);

    Optional fetch(GetDocument request);

    CompletableFuture delete(SearchQuery query, Guarantee guarantee);

    CompletableFuture delete(String documentId, String collection, Guarantee guarantee);

    CompletableFuture createAuditTrail(CreateAuditTrail request);

    default CompletableFuture deleteCollection(String collection) {
        return deleteCollection(collection, Guarantee.STORED);
    }

    CompletableFuture deleteCollection(String collection, Guarantee guarantee);

    List fetchStatistics(SearchQuery query, List fields, List groupBy);

    SearchHistogram fetchHistogram(GetSearchHistogram request);

    List fetchFacetStats(SearchQuery query);

    CompletableFuture bulkUpdate(Collection updates, Guarantee guarantee);

    @Override
    void close();
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy