summaryrefslogtreecommitdiffstats
path: root/streamingvisitors/src/vespa/searchvisitor/indexenvironment.cpp
diff options
context:
space:
mode:
authorHenning Baldersheim <balder@oath.com>2018-02-04 17:30:35 +0100
committerHenning Baldersheim <balder@oath.com>2018-02-04 17:30:35 +0100
commitbf468f0a4367fb5ab9117274bcceb8ba9de59109 (patch)
treea20c562874abac13c4a3d9c51f19ee6b66df71fb /streamingvisitors/src/vespa/searchvisitor/indexenvironment.cpp
parentd1c8e15ee5f8f7cc32ff92be6b881ad01a41e31a (diff)
Rankmanager must also handle fieldsets recursively.
Diffstat (limited to 'streamingvisitors/src/vespa/searchvisitor/indexenvironment.cpp')
-rw-r--r--streamingvisitors/src/vespa/searchvisitor/indexenvironment.cpp19
1 files changed, 16 insertions, 3 deletions
diff --git a/streamingvisitors/src/vespa/searchvisitor/indexenvironment.cpp b/streamingvisitors/src/vespa/searchvisitor/indexenvironment.cpp
index a4ecf655c3d..53e1910b564 100644
--- a/streamingvisitors/src/vespa/searchvisitor/indexenvironment.cpp
+++ b/streamingvisitors/src/vespa/searchvisitor/indexenvironment.cpp
@@ -17,20 +17,33 @@ IndexEnvironment::IndexEnvironment(const ITableManager & tableManager) :
{
}
-IndexEnvironment::~IndexEnvironment() {}
+IndexEnvironment::~IndexEnvironment() = default;
bool
IndexEnvironment::addField(const vespalib::string & name, bool isAttribute)
{
- if (getFieldByName(name) != NULL) {
+ if (getFieldByName(name) != nullptr) {
return false;
}
- FieldInfo info(isAttribute ? FieldType::ATTRIBUTE : FieldType::INDEX, FieldInfo::CollectionType::SINGLE, name, _fields.size());
+ FieldInfo info(isAttribute ? FieldType::ATTRIBUTE : FieldType::INDEX,
+ FieldInfo::CollectionType::SINGLE, name, _fields.size());
info.addAttribute(); // we are able to produce needed attributes at query time
_fields.push_back(info);
_fieldNames[info.name()] = info.id();
return true;
}
+void
+IndexEnvironment::hintAttributeAccess(const string & name) const {
+ if (name.empty()) {
+ return;
+ }
+ if (_motivation == RANK) {
+ _rankAttributes.insert(name);
+ } else {
+ _dumpAttributes.insert(name);
+ }
+}
+
} // namespace storage