@Override public Weight createNormalizedWeight(Query query) throws IOException { try { // if its the main query, use we have dfs data, only then do it if (dfSource != null && (query == searchContext.query() || query == searchContext.parsedQuery().query())) { return dfSource.createNormalizedWeight(query); } return in.createNormalizedWeight(query); } catch (Throwable t) { searchContext.clearReleasables(); throw new RuntimeException(t); } }
@Override public Weight createNormalizedWeight(Query query, boolean needsScores) throws IOException { // TODO: needsScores // can we avoid dfs stuff here if we dont need scores? try { // if its the main query, use we have dfs data, only then do it if (dfSource != null && (query == searchContext.query() || query == searchContext.parsedQuery().query())) { return dfSource.createNormalizedWeight(query, needsScores); } return in.createNormalizedWeight(query, needsScores); } catch (Throwable t) { searchContext.clearReleasables(Lifetime.COLLECTION); throw new RuntimeException(t); } }