aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHenning Baldersheim <balder@yahoo-inc.com>2023-09-22 19:58:17 +0200
committerGitHub <noreply@github.com>2023-09-22 19:58:17 +0200
commit5f032ed57465bbfb60b365e109cbd2d297e2464f (patch)
tree353c99d7bd93b6973682fd19fbf9cfc06fe38caf
parent1a6f2eed481c853e94f5c5c688f28476447423ea (diff)
parent8fffe4a07b409cf31a47dd52429cb2a82c97ea50 (diff)
Merge pull request #28625 from vespa-engine/balder/simplify-attribute-ws
Simplify and cleanup
-rw-r--r--searchlib/src/vespa/searchlib/attribute/attribute_weighted_set_blueprint.cpp13
1 files changed, 4 insertions, 9 deletions
diff --git a/searchlib/src/vespa/searchlib/attribute/attribute_weighted_set_blueprint.cpp b/searchlib/src/vespa/searchlib/attribute/attribute_weighted_set_blueprint.cpp
index 2fac2350735..108128eeb39 100644
--- a/searchlib/src/vespa/searchlib/attribute/attribute_weighted_set_blueprint.cpp
+++ b/searchlib/src/vespa/searchlib/attribute/attribute_weighted_set_blueprint.cpp
@@ -148,8 +148,7 @@ AttributeWeightedSetBlueprint::addToken(std::unique_ptr<ISearchContext> context,
_estHits = std::min(_estHits + context->approximateHits(), _numDocs);
setEstimate(HitEstimate(_estHits, (_estHits == 0)));
_weights.push_back(weight);
- _contexts.push_back(context.get());
- context.release();
+ _contexts.push_back(context.release());
}
queryeval::SearchIterator::UP
@@ -169,18 +168,14 @@ AttributeWeightedSetBlueprint::createLeafSearch(const fef::TermFieldMatchDataArr
children[i] = _contexts[i]->createIterator(child_tfmd, true).release();
}
bool field_is_filter = getState().fields()[0].isFilter();
- return queryeval::SearchIterator::UP(queryeval::WeightedSetTermSearch::create(children, tfmd, field_is_filter, _weights, std::move(match_data)));
+ return queryeval::WeightedSetTermSearch::create(children, tfmd, field_is_filter, _weights, std::move(match_data));
} else { // use attribute filter optimization
- bool isSingleValue = !_attr.hasMultiValue();
bool isString = (_attr.isStringType() && _attr.hasEnum());
- bool isInteger = _attr.isIntegerType();
- assert(isSingleValue);
- (void) isSingleValue;
+ assert(!_attr.hasMultiValue());
if (isString) {
return std::make_unique<AttributeFilter<UseStringEnum>>(tfmd, _attr, _weights, _contexts);
} else {
- assert(isInteger);
- (void) isInteger;
+ assert(_attr.isIntegerType());
return std::make_unique<AttributeFilter<UseInteger>>(tfmd, _attr, _weights, _contexts);
}
}