C
- The type of query element collectorB
- The implementation type of builders
This type is backend-specific. See SearchSortBuilder.toImplementation()
public interface SearchSortBuilderFactory<C,B>
This is the main entry point for the engine to ask the backend to build search sorts.
Modifier and Type | Method and Description |
---|---|
void |
contribute(C collector,
List<B> builders)
Contribute a sort builder to a collector.
|
DistanceSortBuilder<B> |
distance(String absoluteFieldPath,
GeoPoint location) |
FieldSortBuilder<B> |
field(String absoluteFieldPath) |
B |
indexOrder() |
ScoreSortBuilder<B> |
score() |
void |
toImplementation(SearchSort sort,
Consumer<? super B> implementationConsumer)
Convert a
SearchSort object back to a sequence of sort builders. |
SearchSort |
toSearchSort(List<B> builders)
Convert sort builders to a reusable
SearchSort object. |
SearchSort toSearchSort(List<B> builders)
SearchSort
object.
Implementations may decide to just wrap the builders if they are reusable, or to convert them to another representation if they are not reusable.
builders
- The sort builder implementations.SearchSort
object.void toImplementation(SearchSort sort, Consumer<? super B> implementationConsumer)
SearchSort
object back to a sequence of sort builders.
May be called multiple times for a given SearchSort
object.
sort
- The SearchSort
object to convert.implementationConsumer
- A collector for the corresponding sort builder implementations.SearchException
- If the SearchSort
object was created
by a different, incompatible factory.void contribute(C collector, List<B> builders)
May be called multiple times per collector, if there are multiple sorts.
collector
- The query element collector.builders
- The sort builder implementations.ScoreSortBuilder<B> score()
FieldSortBuilder<B> field(String absoluteFieldPath)
DistanceSortBuilder<B> distance(String absoluteFieldPath, GeoPoint location)
B indexOrder()
Copyright © 2006-2019 Red Hat, Inc. and others. Licensed under the GNU Lesser General Public License (LGPL), version 2.1 or later.