Repository navigation
GITHUB#16997 Negative Query Optimizations for Lucene Monitor Presearcher (Part II) - #17032
Conversation
…dNameMapper (DEFAULT, or pass(i) for multipass).
…ngle negation across combines
…notslot # Conflicts: # lucene/CHANGES.txt
| queries[i] = new BooleanQuery.Builder(); | ||
| } | ||
| } | ||
| Map<String, List<BytesRef>> negatableTerms = new HashMap<>(); |
There was a problem hiding this comment.
It's a List instead of a BytesRefHash (as in the case of terms) because we don't need to deduplicate.
| } | ||
| String field = fields.map(entry.getKey()); | ||
| addField(doc, field, entry.getValue()); | ||
| if (!field.equals(entry.getKey())) { |
There was a problem hiding this comment.
This was moved from MPTFPS so you can argue it is leaking some pass-related behavior into TFPS. However, behaviorally this only matters if you have non-identity field mapper.
| */ | ||
| private static void addRawTerms(Document doc, String field, BytesRefHash terms) { | ||
| BytesRef scratch = new BytesRef(); | ||
| for (int i = 0; i < terms.size(); i++) { |
There was a problem hiding this comment.
Potentially continuing conversation from #16998 (comment) @romseygeek
| // read directly: TermsEnumTokenStream can merge invalid UTF-8 terms, which must not exclude | ||
| String notField = field + NOT_SUFFIX; | ||
| for (BytesRef term = terms.next(); term != null; term = terms.next()) { | ||
| if (terms.docFreq() == maxDoc && termAcceptor.test(notField, term)) { |
There was a problem hiding this comment.
Multi-doc batches don't work well with this feature as currently implemented. I am not a user of the batch feature but analyzing this PR made me realize that they don't work well with the current MultiPassTermFilteredPresearcher either. More details here #17004. I think if we can address the linked issue this won't really be a problem.
romseygeek
left a comment
There was a problem hiding this comment.
This all makes sense to me. Thanks for all your work here @kotman12!
Description
Follow up of #16998
I've kept the core
QueryTreechanges in the original PR and moved the integration bits into this one. Once the first one merges this diff will get smaller. I may have to port some of the comments from the previous one here.