Module org.elasticsearch.server
Interface QueryRewriteInterceptor
- All Known Implementing Classes:
QueryRewriteInterceptor.CompositeQueryRewriteInterceptor,QueryRewriteInterceptor.NoOpQueryRewriteInterceptor
public interface QueryRewriteInterceptor
Enables modules and plugins to intercept and rewrite queries during the query rewrite phase on the coordinator node.
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic classstatic class -
Method Summary
Modifier and TypeMethodDescriptionName of the query to be intercepted and rewritten.interceptAndRewrite(QueryRewriteContext context, QueryBuilder queryBuilder) Intercepts and returns a rewritten query if modifications are required; otherwise, returns the same providedQueryBuilderinstance unchanged.static QueryRewriteInterceptormulti(Map<String, QueryRewriteInterceptor> interceptors)
-
Method Details
-
interceptAndRewrite
Intercepts and returns a rewritten query if modifications are required; otherwise, returns the same providedQueryBuilderinstance unchanged.- Parameters:
context- theQueryRewriteContextproviding the context for the rewrite operationqueryBuilder- the originalQueryBuilderto potentially rewrite- Returns:
- the rewritten
QueryBuilder, or the original instance if no rewrite was needed
-
getQueryName
String getQueryName()Name of the query to be intercepted and rewritten. -
multi
-