Class FilterQueryRequestProcessor

java.lang.Object
org.opensearch.search.pipeline.AbstractProcessor
org.opensearch.search.pipeline.common.FilterQueryRequestProcessor
All Implemented Interfaces:
Processor, SearchRequestProcessor

public class FilterQueryRequestProcessor extends AbstractProcessor implements SearchRequestProcessor
This is a SearchRequestProcessor that replaces the incoming query with a BooleanQuery that MUST match the incoming query with a FILTER clause based on the configured query.
  • Field Details

  • Method Details

    • getType

      public String getType()
      Returns the type of the processor.
      Specified by:
      getType in interface Processor
      Returns:
      The processor type.
    • processRequest

      public SearchRequest processRequest(SearchRequest request) throws Exception
      Modifies the search request by adding a filtered query to the existing query, if any, and sets it as the new query in the search request's SearchSourceBuilder.
      Specified by:
      processRequest in interface SearchRequestProcessor
      Parameters:
      request - The search request to be processed.
      Returns:
      The modified search request.
      Throws:
      Exception - if an error occurs while processing the request.