diff options
author | Tor Egge <Tor.Egge@online.no> | 2023-07-04 15:36:32 +0200 |
---|---|---|
committer | Tor Egge <Tor.Egge@online.no> | 2023-07-04 15:36:32 +0200 |
commit | f49ff6ae01de4f04bb547eb85cc49c1c8828b145 (patch) | |
tree | 85253442c9f957c01246568ada7b33718f84a0a6 /streamingvisitors/src | |
parent | b3abb357a1d64c19f9be1efeb60b43da244c4391 (diff) |
Handle sorting on multivalue attributes.
Diffstat (limited to 'streamingvisitors/src')
-rw-r--r-- | streamingvisitors/src/vespa/searchvisitor/searchvisitor.cpp | 24 |
1 files changed, 10 insertions, 14 deletions
diff --git a/streamingvisitors/src/vespa/searchvisitor/searchvisitor.cpp b/streamingvisitors/src/vespa/searchvisitor/searchvisitor.cpp index b34a5f4407c..95cd4788d7f 100644 --- a/streamingvisitors/src/vespa/searchvisitor/searchvisitor.cpp +++ b/streamingvisitors/src/vespa/searchvisitor/searchvisitor.cpp @@ -886,22 +886,18 @@ SearchVisitor::setupAttributeVectorsForSorting(const search::common::SortSpec & if ( fid != StringFieldIdTMap::npos ) { AttributeGuard::UP attr(_attrMan.getAttribute(sInfo._field)); if (attr->valid()) { - if (!(*attr)->hasMultiValue()) { - size_t index(_attributeFields.size()); - for(size_t j(0); j < index; j++) { - if (_attributeFields[j]._field == fid) { - index = j; - _attributeFields[index]._ascending = sInfo._ascending; - _attributeFields[index]._converter = sInfo._converter.get(); - } + size_t index(_attributeFields.size()); + for(size_t j(0); j < index; j++) { + if (_attributeFields[j]._field == fid) { + index = j; + _attributeFields[index]._ascending = sInfo._ascending; + _attributeFields[index]._converter = sInfo._converter.get(); } - if (index == _attributeFields.size()) { - _attributeFields.emplace_back(fid, std::move(attr), sInfo._ascending, sInfo._converter.get()); - } - _sortList.push_back(index); - } else { - LOG(warning, "Attribute '%s' is not sortable", sInfo._field.c_str()); } + if (index == _attributeFields.size()) { + _attributeFields.emplace_back(fid, std::move(attr), sInfo._ascending, sInfo._converter.get()); + } + _sortList.push_back(index); } else { LOG(warning, "Attribute '%s' is not valid", sInfo._field.c_str()); } |