Handle ReferenceFieldValue in document selection expression.
#include <vespa/document/base/exceptions.h>
#include <vespa/document/update/documentupdate.h>
#include <vespa/document/fieldvalue/fieldvalues.h>
+#include <vespa/document/fieldvalue/referencefieldvalue.h>
#include <vespa/document/fieldvalue/iteratorhandler.h>
#include <vespa/document/datatype/documenttype.h>
#include <vespa/vespalib/util/md5.h>
@@ -303,6 +304,15 @@ IteratorHandler::getInternalValue(const FieldValue& fval) const
const StringFieldValue& val(dynamic_cast<const StringFieldValue&>(fval));
return std::make_unique<StringValue>(val.getAsString());
}
+ case ReferenceFieldValue::classId:
+ {
+ const ReferenceFieldValue& val(dynamic_cast<const ReferenceFieldValue&>(fval));
+ if (val.hasValidDocumentId()) {
+ return std::make_unique<StringValue>(val.getDocumentId().toString());
+ } else {
+ return std::make_unique<InvalidValue>();
+ }
+ }
case ArrayFieldValue::classId:
{
const ArrayFieldValue& val(dynamic_cast<const ArrayFieldValue&>(fval));
