Package de.cxp.ocs.api.searcher
Interface SearchService
- All Known Implementing Classes:
SearchClient
,SearchController
@Path("search-api/v1")
public interface SearchService
-
Method Summary
Modifier and TypeMethodDescriptionarrangedSearch
(String tenant, ArrangedSearchQuery searchQuery) getDocument
(String tenant, String docId) String[]
Search the index using the given searchQuery.
-
Method Details
-
search
@GET @Path("search/{tenant}") SearchResult search(String tenant, SearchQuery searchQuery, Map<String, String> filters) throws ExceptionSearch the index using the given searchQuery. Each tenant can have its own configuration. Different tenants may still use the same indexes. This is defined by the underlying configuration.- Parameters:
tenant
- the name that correlates to the index configurationsearchQuery
- the user's search termsfilters
- Any other parameters are used as filters. They are validated according to the actual data and configuration. Each filter can have multiple values, separated by comma. Commas inside the values have to be double-URL encoded. Depending on the configured backend type these values are used differently. Examples:- brand=adidas
- brand=adidas,nike (products from adidas OR nike are shown)
- category=men,shoes,sneaker (if category would be configured as path, these values are used for hierarchical filtering)
- price=10,99.99 (if price is configured as numeric field, these values are used as range filters)
- color=red,black (if that field is configured to be used for "exclusive filtering" only products would be shown that are available in red AND black)
- optional for the future also negations could be supported, e.g. color=red,!black
- Returns:
- the result of that search request
- Throws:
Exception
-- if tenant can't be accessed
- if according index does not exist
-
arrangedSearch
@POST @Path("search/arranged/{tenant}") SearchResult arrangedSearch(String tenant, ArrangedSearchQuery searchQuery) throws Exception - Throws:
Exception
-
getDocument
- Throws:
Exception
-
getTenants
-