Class SortResponseProcessor
java.lang.Object
org.opensearch.search.pipeline.AbstractProcessor
org.opensearch.search.pipeline.common.SortResponseProcessor
- All Implemented Interfaces:
Processor,SearchResponseProcessor
Processor that sorts an array of items.
Throws exception is the specified field is not an array.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumEnum defining how elements will be sortedNested classes/interfaces inherited from interface org.opensearch.search.pipeline.Processor
Processor.PipelineContext, Processor.PipelineSource -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringDefault sort order if not specifiedstatic final StringKey defining the array field to be sorted.static final StringOptional key defining the sort order.static final StringOptional key to put the sorted values in a different field.static final StringKey to reference this processor type from a search pipeline. -
Method Summary
Modifier and TypeMethodDescriptionGetter function for sortFieldGetter function for sortOrderGetter function for targetFieldgetType()processResponse(SearchRequest request, SearchResponse response) Methods inherited from class org.opensearch.search.pipeline.AbstractProcessor
getDescription, getTag, isIgnoreFailureMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.opensearch.search.pipeline.Processor
getDescription, getTag, isIgnoreFailureMethods inherited from interface org.opensearch.search.pipeline.SearchResponseProcessor
processResponse, processResponseAsync
-
Field Details
-
TYPE
Key to reference this processor type from a search pipeline.- See Also:
-
SORT_FIELD
Key defining the array field to be sorted.- See Also:
-
SORT_ORDER
Optional key defining the sort order.- See Also:
-
TARGET_FIELD
Optional key to put the sorted values in a different field.- See Also:
-
DEFAULT_ORDER
Default sort order if not specified- See Also:
-
-
Method Details
-
getSortField
Getter function for sortField- Returns:
- sortField
-
getTargetField
Getter function for targetField- Returns:
- targetField
-
getSortOrder
Getter function for sortOrder- Returns:
- sortOrder
-
getType
-
processResponse
public SearchResponse processResponse(SearchRequest request, SearchResponse response) throws Exception - Specified by:
processResponsein interfaceSearchResponseProcessor- Throws:
Exception
-