summaryrefslogtreecommitdiffstats
path: root/streamingvisitors
diff options
context:
space:
mode:
authorTor Egge <Tor.Egge@online.no>2023-03-22 13:55:11 +0100
committerTor Egge <Tor.Egge@online.no>2023-03-22 13:55:11 +0100
commit62498b4a1c227a7a3d863c0be34204ee93654f06 (patch)
tree1f0ad89ce5b534bad749b945af1fcbc20cb55bc6 /streamingvisitors
parent7c21c2ad4180a164ac57431afc983568a36ba8e1 (diff)
Wire in SingleRawExtAttribute.
Diffstat (limited to 'streamingvisitors')
-rw-r--r--streamingvisitors/src/vespa/searchvisitor/searchvisitor.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/streamingvisitors/src/vespa/searchvisitor/searchvisitor.cpp b/streamingvisitors/src/vespa/searchvisitor/searchvisitor.cpp
index b4b7a698178..d0e3d1f038b 100644
--- a/streamingvisitors/src/vespa/searchvisitor/searchvisitor.cpp
+++ b/streamingvisitors/src/vespa/searchvisitor/searchvisitor.cpp
@@ -10,6 +10,7 @@
#include <vespa/document/datatype/weightedsetdatatype.h>
#include <vespa/document/datatype/mapdatatype.h>
#include <vespa/searchlib/aggregation/modifiers.h>
+#include <vespa/searchlib/attribute/single_raw_ext_attribute.h>
#include <vespa/searchlib/common/packets.h>
#include <vespa/searchlib/uca/ucaconverter.h>
#include <vespa/searchlib/features/setup.h>
@@ -108,6 +109,8 @@ createAttribute(const vespalib::string & name, const document::FieldValue & fv)
return std::make_shared<search::SingleFloatExtAttribute>(name);
} else if (fv.isA(document::FieldValue::Type::STRING)) {
return std::make_shared<search::SingleStringExtAttribute>(name);
+ } else if (fv.isA(document::FieldValue::Type::RAW)) {
+ return std::make_shared<search::attribute::SingleRawExtAttribute>(name);
} else {
LOG(debug, "Can not make an attribute out of %s of type '%s'.", name.c_str(), fv.className());
}
@@ -438,6 +441,9 @@ SearchVisitor::AttributeInserter::onPrimitive(uint32_t, const Content & c)
attr.add(value.getAsDouble(), c.getWeight());
} else if (_attribute.isStringType()) {
attr.add(value.getAsString().c_str(), c.getWeight());
+ } else if (_attribute.is_raw_type()) {
+ auto raw_value = value.getAsRaw();
+ attr.add(vespalib::ConstArrayRef<char>(raw_value.first, raw_value.second), c.getWeight());
} else {
assert(false && "We got an attribute vector that is of an unknown type");
}