S - The "self" type (the actual exposed type of this step).
May be a subtype of SearchQueryOptionsStep with more exposed methods.H - The type of hits for the created query.SF - The type of factory used to create sorts in sort(Function).public interface SearchQueryOptionsStep<S extends SearchQueryOptionsStep<? extends S,H,SF>,H,SF extends SearchSortFactory> extends SearchQueryFinalStep<H>, SearchFetchable<H>
sorts can be set,
and where the query can be executed or retrieved as an object.| Modifier and Type | Method and Description |
|---|---|
S |
routing(Collection<String> routingKeys)
Configure routing of the search query.
|
S |
routing(String routingKey)
Configure routing of the search query.
|
S |
sort(Function<? super SF,? extends SortFinalStep> sortContributor)
Add a sort to this query.
|
S |
sort(SearchSort sort)
Add a sort to this query.
|
toQueryfetch, fetch, fetch, fetchHits, fetchHits, fetchHits, fetchSingleHit, fetchTotalHitCountS routing(String routingKey)
Useful when indexes are sharded, to limit the number of shards interrogated by the search query.
This method may be called multiple times, in which case all submitted routing keys will be taken into account.
By default, if routing is not configured, all shards will be queried.
routingKey - A string key. All shards matching this key will be queried.this, for method chaining.S routing(Collection<String> routingKeys)
Similar to routing(String), but allows passing multiple keys in a single call.
routingKeys - A collection containing zero, one or multiple string keys.this, for method chaining.S sort(SearchSort sort)
sort - A SearchSort object obtained from the search scope.this, for method chaining.S sort(Function<? super SF,? extends SortFinalStep> sortContributor)
sortContributor - A function that will use the factory passed in parameter to create a sort,
returning the final step in the sort DSL.
Should generally be a lambda expression.this, for method chaining.Copyright © 2006-2019 Red Hat, Inc. and others. Licensed under the GNU Lesser General Public License (LGPL), version 2.1 or later.