Skip to content

Commit

Permalink
Also delegate rewrite the the wrapped IndexSearcher.
Browse files Browse the repository at this point in the history
In the the AssertingIndexSearcher is used we then also have extra validation when rewritting the query.
  • Loading branch information
martijnvg committed Aug 14, 2015
1 parent 2fecc7e commit 0688ddd
Showing 1 changed file with 10 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,16 @@ public void dfSource(CachedDfSource dfSource) {
this.dfSource = dfSource;
}

@Override
public Query rewrite(Query original) throws IOException {
try {
return in.rewrite(original);
} catch (Throwable t) {
searchContext.clearReleasables(Lifetime.COLLECTION);
throw ExceptionsHelper.convertToElastic(t);
}
}

@Override
public Weight createNormalizedWeight(Query query, boolean needsScores) throws IOException {
try {
Expand Down

0 comments on commit 0688ddd

Please sign in to comment.