diff options
author | Henning Baldersheim <balder@yahoo-inc.com> | 2022-03-16 17:36:04 +0000 |
---|---|---|
committer | Henning Baldersheim <balder@yahoo-inc.com> | 2022-03-16 18:06:45 +0000 |
commit | cea11eaf40659b879d143f99eee2f6b78e427761 (patch) | |
tree | 88a81f4697a51d889af52daf1b581eeb3ee6385e /searchsummary | |
parent | fd26131762bf938c033178637604df97076ffcdf (diff) |
Avoid requiring identifiable for FieldValue
Diffstat (limited to 'searchsummary')
-rw-r--r-- | searchsummary/src/vespa/searchsummary/docsummary/matched_elements_filter_dfw.cpp | 2 | ||||
-rw-r--r-- | searchsummary/src/vespa/searchsummary/docsummary/summaryfieldconverter.cpp | 11 |
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; } |