Skip to content

Commit

Permalink
PR feedback - remove check on QueryRewriteContext class only
Browse files Browse the repository at this point in the history
  • Loading branch information
kderusso committed Dec 5, 2024
1 parent 9640ad1 commit bc7f735
Show file tree
Hide file tree
Showing 6 changed files with 0 additions and 27 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -149,11 +149,6 @@ public CoordinatorRewriteContext convertToCoordinatorRewriteContext() {
return this;
}

@Override
public QueryRewriteContext convertToQueryRewriteContext() {
return null;
}

@Override
public String getTierPreference() {
// dominant branch first (tier preference is configured)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,4 @@ public DataRewriteContext convertToDataRewriteContext() {
return this;
}

@Override
public QueryRewriteContext convertToQueryRewriteContext() {
return null;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,6 @@ public InnerHitsRewriteContext convertToInnerHitsRewriteContext() {
return this;
}

@Override
public QueryRewriteContext convertToQueryRewriteContext() {
return null;
}

@Override
public void executeAsyncActions(ActionListener<Void> listener) {
// InnerHitsRewriteContext does not support async actions at all, and doesn't supply a valid `client` object
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -209,10 +209,6 @@ public InnerHitsRewriteContext convertToInnerHitsRewriteContext() {
return null;
}

public QueryRewriteContext convertToQueryRewriteContext() {
return this;
}

/**
* Returns the {@link MappedFieldType} for the provided field name.
* If the field is not mapped, the behaviour depends on the index.query.parse.allow_unmapped_fields setting, which defaults to true.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -662,11 +662,6 @@ public final SearchExecutionContext convertToSearchExecutionContext() {
return this;
}

@Override
public QueryRewriteContext convertToQueryRewriteContext() {
return null;
}

/** Return the current {@link IndexReader}, or {@code null} if no index reader is available,
* for instance if this rewrite context is used to index queries (percolation).
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,6 @@ public QueryBuilder rewrite(QueryRewriteContext context, QueryBuilder queryBuild
return queryBuilder;
}

if (context.convertToQueryRewriteContext() == null) {
return queryBuilder;
}

MatchQueryBuilder matchQueryBuilder = (MatchQueryBuilder) queryBuilder;
QueryBuilder rewritten = queryBuilder;
if (matchQueryBuilder.getInterceptedAndRewritten() == false) {
Expand Down

0 comments on commit bc7f735

Please sign in to comment.