rmuir commented on PR #12118: URL: https://github.com/apache/lucene/pull/12118#issuecomment-1410426974
example pseudocode: ``` @Override public Weight createWeight(IndexSearcher searcher, ScoreMode scoreMode, float boost) throws IOException { if (!scoreMode.needsScores()) { // if scores are not needed, let TermWeight deal with optimizing that case. TermQuery tq = new TermQuery(new Term(fieldName, featureName)); return searcher .rewrite(tq) .createWeight(searcher, ScoreMode.COMPLETE_NO_SCORES, boost); } ... } ``` This would ensure that it gets all the optimizations of TermQuery and keep the code simple. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: issues-unsubscr...@lucene.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: issues-unsubscr...@lucene.apache.org For additional commands, e-mail: issues-h...@lucene.apache.org