Interface SearchQueryExtension<Q,H>
- Type Parameters:
Q
- The type of search queries wrappers created by this extension.H
- The type of hits in the query to be wrapped.
- All Known Implementing Classes:
ElasticsearchExtension
,LuceneExtension
public interface SearchQueryExtension<Q,H>
An extension to the search query, allowing to wrap a query.
WARNING: while this type is API, because instances should be manipulated by users,
all of its methods are considered SPIs and therefore should never be called or implemented directly by users.
In short, users are only expected to get instances of this type from an API (SomeExtension.get()
)
and pass it to another API.
-
Method Summary
Modifier and TypeMethodDescriptionextendOptional
(SearchQuery<H> original, SearchLoadingContext<?> loadingContext) Attempt to extend a given query, returning an emptyOptional
in case of failure.
-
Method Details
-
extendOptional
Attempt to extend a given query, returning an emptyOptional
in case of failure.WARNING: this method is not API, see comments at the type level.
- Parameters:
original
- The original, non-extendedSearchQuery
.loadingContext
- TheSearchLoadingContext
used by the original query.- Returns:
- An optional containing the extended search query (
SearchQueryExtension
) in case of success, or an empty optional otherwise.
-