OPENDJ-2119 CR-7476 debugsearchindex incorrect output with AND search on only one attribute
Running a search while asking for debug information about filter processing should return for each AVA what happened.
If we detect the search can be simplified as a bounded range, though, only partial information is printed, since we "forget"
to update the debug information, normally updated by each evaluation.
| | |
| | | // in IndexFilter#evaluateLogicalAndFilter method. |
| | | // One solution could be to implement a boundedRangeAssertion that combine |
| | | // the two operations in one. |
| | | EntryIDSet results = evaluate(filter1, debugBuffer, monitor); |
| | | EntryIDSet results2 = evaluate(filter2, debugBuffer, monitor); |
| | | results.retainAll(results2); |
| | | return results; |
| | | StringBuilder tmpBuff1 = debugBuffer != null ? new StringBuilder(): null; |
| | | StringBuilder tmpBuff2 = debugBuffer != null ? new StringBuilder(): null; |
| | | EntryIDSet results1 = evaluate(filter1, tmpBuff1, monitor); |
| | | EntryIDSet results2 = evaluate(filter2, tmpBuff2, monitor); |
| | | if (debugBuffer != null) |
| | | { |
| | | debugBuffer |
| | | .append(filter1).append(tmpBuff1).append(results1) |
| | | .append(filter2).append(tmpBuff2).append(results2); |
| | | } |
| | | results1.retainAll(results2); |
| | | return results1; |
| | | } |
| | | |
| | | private EntryIDSet evaluate(SearchFilter filter, StringBuilder debugBuffer, DatabaseEnvironmentMonitor monitor) |
| | |
| | | // in IndexFilter#evaluateLogicalAndFilter method. |
| | | // One solution could be to implement a boundedRangeAssertion that combine |
| | | // the two operations in one. |
| | | EntryIDSet results = evaluate(indexQueryFactory, filter1, debugBuffer, monitor); |
| | | EntryIDSet results2 = evaluate(indexQueryFactory, filter2, debugBuffer, monitor); |
| | | results.retainAll(results2); |
| | | return results; |
| | | StringBuilder tmpBuff1 = debugBuffer != null ? new StringBuilder() : null; |
| | | StringBuilder tmpBuff2 = debugBuffer != null ? new StringBuilder() : null; |
| | | EntryIDSet results1 = evaluate(indexQueryFactory, filter1, tmpBuff1, monitor); |
| | | EntryIDSet results2 = evaluate(indexQueryFactory, filter2, tmpBuff2, monitor); |
| | | if (debugBuffer != null) |
| | | { |
| | | debugBuffer |
| | | .append(filter1).append(tmpBuff1).append(results1) |
| | | .append(filter2).append(tmpBuff2).append(results2); |
| | | } |
| | | results1.retainAll(results2); |
| | | return results1; |
| | | } |
| | | |
| | | private EntryIDSet evaluate(IndexQueryFactory<IndexQuery> indexQueryFactory, SearchFilter filter, |