
io.github.honhimw.ms.api.Search Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of meilisearch-rest-client
Show all versions of meilisearch-rest-client
Reactive meilisearch rest client powered by reactor-netty-http.
/*
* 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.github.honhimw.ms.api;
import io.github.honhimw.ms.json.TypeRef;
import io.github.honhimw.ms.model.FacetSearchRequest;
import io.github.honhimw.ms.model.FacetSearchResponse;
import io.github.honhimw.ms.model.SearchRequest;
import io.github.honhimw.ms.model.SearchResponse;
import io.swagger.v3.oas.annotations.Operation;
import java.util.Map;
import java.util.function.Consumer;
/**
* Meilisearch exposes 3 routes to perform document searches:
*
* - A POST route: this is the preferred route when using API authentication, as it allows preflight request caching and better performances.
* - A GET route: the usage of this route is discouraged, unless you have good reason to do otherwise (specific caching abilities for example). Other than the differences mentioned above, the two routes are strictly equivalent.
* - A POST multi-search route allowing to perform multiple search queries in a single HTTP request. Meilisearch exposes 1 route to perform facet searches:
* - A POST facet-search route allowing to perform a facet search query on a facet in a single HTTP request.
*
*
* @author hon_him
* @since 2024-01-02
*/
public interface Search {
/**
* Search for documents matching a specific query in the given index.
* This is the preferred route to perform search when an API key is required, as it allows for preflight requests to be cached. Caching preflight requests improves considerably the speed of the search.
*
* @param q Query string
* @return search result
*/
@Operation(method = "POST", tags = "/indexes/{indexUid}/search")
SearchResponse
© 2015 - 2025 Weber Informatics LLC | Privacy Policy