summaryrefslogtreecommitdiffstats
path: root/searchsummary
diff options
context:
space:
mode:
authorHenning Baldersheim <balder@yahoo-inc.com>2022-03-22 09:49:57 +0100
committerGitHub <noreply@github.com>2022-03-22 09:49:57 +0100
commit29a9815bc0962b97ed36e80ffe9784d789365025 (patch)
tree58f36ebd93a39be8770a0b663cc0655dc394cac8 /searchsummary
parent4a6506e8e721d75d91e1398a876653df1e749d2b (diff)
parentb35bb7fb3add35ff916cbad80a8764a4533798d1 (diff)
Merge pull request #21715 from vespa-engine/balder/avoid-identifiable-fieldvalue
Avoid requiring identifiable for FieldValue
Diffstat (limited to 'searchsummary')
-rw-r--r--searchsummary/src/vespa/searchsummary/docsummary/matched_elements_filter_dfw.cpp2
-rw-r--r--searchsummary/src/vespa/searchsummary/docsummary/summaryfieldconverter.cpp11
2 files changed, 4 insertions, 9 deletions
diff --git a/searchsummary/src/vespa/searchsummary/docsummary/matched_elements_filter_dfw.cpp b/searchsummary/src/vespa/searchsummary/docsummary/matched_elements_filter_dfw.cpp
index 2c2ce860e39..fb53ddcc470 100644
--- a/searchsummary/src/vespa/searchsummary/docsummary/matched_elements_filter_dfw.cpp
+++ b/searchsummary/src/vespa/searchsummary/docsummary/matched_elements_filter_dfw.cpp
@@ -82,7 +82,7 @@ filter_matching_elements_in_input_field_while_converting_to_slime(const FieldVal
// Only difference is that we filter matched elements on the fly.
auto converted = SummaryFieldConverter::convert_field_with_filter(false, input_field_value, matching_elems);
// This should hold as we also have asserted that (type == ResType::RES_JSONSTRING);
- assert(converted->getClass().inherits(LiteralFieldValueB::classId));
+ assert(converted->isLiteral());
auto& literal = static_cast<const LiteralFieldValueB&>(*converted);
vespalib::stringref buf = literal.getValueRef();
Slime input_field_as_slime;
diff --git a/searchsummary/src/vespa/searchsummary/docsummary/summaryfieldconverter.cpp b/searchsummary/src/vespa/searchsummary/docsummary/summaryfieldconverter.cpp
index 487fb9e329f..c107e5c8739 100644
--- a/searchsummary/src/vespa/searchsummary/docsummary/summaryfieldconverter.cpp
+++ b/searchsummary/src/vespa/searchsummary/docsummary/summaryfieldconverter.cpp
@@ -29,7 +29,6 @@
#include <vespa/eval/eval/value_codec.h>
#include <vespa/searchcommon/common/schema.h>
#include <vespa/searchlib/util/url.h>
-#include <vespa/vespalib/encoding/base64.h>
#include <vespa/vespalib/geo/zcurve.h>
#include <vespa/vespalib/stllike/asciistream.h>
#include <vespa/vespalib/util/size_literals.h>
@@ -176,7 +175,7 @@ void handleIndexingTerms(Handler &handler, const StringFieldValue &value) {
const StringFieldValue &ensureStringFieldValue(const FieldValue &value) __attribute__((noinline));
const StringFieldValue &ensureStringFieldValue(const FieldValue &value) {
- if (!value.inherits(IDENTIFIABLE_CLASSID(StringFieldValue))) {
+ if (!value.isA(FieldValue::Type::STRING)) {
throw vespalib::IllegalArgumentException("Illegal field type. " + value.toString(), VESPA_STRLOC);
}
return static_cast<const StringFieldValue &>(value);
@@ -287,9 +286,7 @@ class SummaryFieldValueConverter : protected ConstFieldValueVisitor
void visit(const StructFieldValue &value) override {
if (*value.getDataType() == *SearchDataType::URI) {
FieldValue::UP uriAllValue = value.getValue("all");
- if (uriAllValue &&
- uriAllValue->inherits(IDENTIFIABLE_CLASSID(StringFieldValue)))
- {
+ if (uriAllValue && uriAllValue->isA(FieldValue::Type::STRING)) {
uriAllValue->accept(*this);
return;
}
@@ -488,9 +485,7 @@ private:
}
if (*value.getDataType() == *SearchDataType::URI) {
FieldValue::UP uriAllValue = value.getValue("all");
- if (uriAllValue &&
- uriAllValue->inherits(IDENTIFIABLE_CLASSID(StringFieldValue)))
- {
+ if (uriAllValue && uriAllValue->isA(FieldValue::Type::STRING)) {
uriAllValue->accept(*this);
return;
}