Also delegate rewrite the the wrapped IndexSearcher.

In the the AssertingIndexSearcher is used we then also have extra validation when rewritting the query.
This commit is contained in:
Martijn van Groningen 2015-08-14 16:34:04 +02:00
parent 2fecc7e5c9
commit 0688dddebf
1 changed files with 10 additions and 0 deletions

View File

@ -63,6 +63,16 @@ public class ContextIndexSearcher extends IndexSearcher implements Releasable {
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 {