Better handling of quote terms, fix bug in handling of longer queries.

... where some terms may previously have been ignored. The latter bug was due to the handling of QueryHeads with AnyOf-style predicates interacting poorly with alreadyConsideredTerms in SearchIndex.java
This commit is contained in:
Viktor Lofgren 2023-04-10 13:20:40 +02:00
parent fe419b12b4
commit e49b1dd155
2 changed files with 2 additions and 29 deletions

View File

@ -12,9 +12,9 @@ public interface IndexQueryBuilder {
IndexQueryBuilder alsoFull(int termId);
/**
* Filters documents that also contain <i>any of the provided termIds</i>, within the priority index.
* Filters documents that also contain the termId, within the priority index.
*/
IndexQueryBuilder alsoPrioAnyOf(int... termIds);
IndexQueryBuilder alsoPrio(int termIds);
/** Excludes documents that contain termId, within the full index
*/

View File

@ -52,33 +52,6 @@ public class SearchIndexQueryBuilder implements IndexQueryBuilder {
return this;
}
public IndexQueryBuilder alsoPrioAnyOf(int... termIds) {
QueryFilterStepIf step;
if (termIds.length == 0) {
step = QueryFilterStepIf.noPass();
}
else if (termIds.length == 1) {
return alsoPrio(termIds[0]);
}
else {
var steps = IntStream.of(termIds)
.filter(alreadyConsideredTerms::add)
.mapToObj(reverseIndexPrioReader::also)
.collect(Collectors.toList());
if (steps.isEmpty())
return this;
step = QueryFilterStepIf.anyOf(steps);
}
query.addInclusionFilter(step);
return this;
}
public IndexQueryBuilder notFull(int termId) {
query.addInclusionFilter(reverseIndexFullReader.not(termId));