Skip to content

Commit

Permalink
Add comment
Browse files Browse the repository at this point in the history
  • Loading branch information
romseygeek committed Oct 4, 2023
1 parent 5fda2c1 commit 735f4c8
Showing 1 changed file with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -302,6 +302,9 @@ public Matches matches(LeafReaderContext context, int doc) throws IOException {
if (fi == null) {
return null;
}
// Some highlighters will already have reindexed the source with positions and offsets,
// so rather than doing it again we check to see if this data is available on the
// current context and if so delegate directly to the inner query
if (fi.getIndexOptions().compareTo(IndexOptions.DOCS_AND_FREQS_AND_POSITIONS) > 0) {
Weight innerWeight = in.createWeight(searcher, ScoreMode.COMPLETE_NO_SCORES, 1);
return innerWeight.matches(context, doc);
Expand Down

0 comments on commit 735f4c8

Please sign in to comment.