Class RenameFieldResponseProcessor
java.lang.Object
org.opensearch.search.pipeline.AbstractProcessor
org.opensearch.search.pipeline.common.RenameFieldResponseProcessor
- All Implemented Interfaces:
Processor,SearchResponseProcessor
public class RenameFieldResponseProcessor
extends AbstractProcessor
implements SearchResponseProcessor
This is a
SearchRequestProcessor that renames a field before returning the search response-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classThis is a factor that creates the RenameResponseProcessorNested classes/interfaces inherited from interface org.opensearch.search.pipeline.Processor
Processor.PipelineContext, Processor.PipelineSource -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringKey to reference this processor type from a search pipeline.Fields inherited from interface org.opensearch.search.pipeline.Processor
PIPELINE_SOURCE -
Constructor Summary
ConstructorsConstructorDescriptionRenameFieldResponseProcessor(String tag, String description, boolean ignoreFailure, String oldField, String newField, boolean ignoreMissing) Constructor that takes a target field to rename and the new name -
Method Summary
Modifier and TypeMethodDescriptionGetter function for newFieldGetter function for oldFieldgetType()booleanGetter function for ignoreMissingprocessResponse(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, isIgnoreFailure
-
Field Details
-
TYPE
Key to reference this processor type from a search pipeline.- See Also:
-
-
Constructor Details
-
RenameFieldResponseProcessor
public RenameFieldResponseProcessor(String tag, String description, boolean ignoreFailure, String oldField, String newField, boolean ignoreMissing) Constructor that takes a target field to rename and the new name- Parameters:
tag- processor tagdescription- processor descriptionignoreFailure- option to ignore failureoldField- name of field to be renamednewField- name of field that will replace the old fieldignoreMissing- if true, do not throw error if oldField does not exist within search response
-
-
Method Details
-
getType
-
getOldField
Getter function for oldField- Returns:
- oldField
-
getNewField
Getter function for newField- Returns:
- newField
-
isIgnoreMissing
public boolean isIgnoreMissing()Getter function for ignoreMissing- Returns:
- ignoreMissing
-
processResponse
public SearchResponse processResponse(SearchRequest request, SearchResponse response) throws Exception - Specified by:
processResponsein interfaceSearchResponseProcessor- Throws:
Exception
-