diff options
author | Arne H Juul <arnej@yahooinc.com> | 2022-02-04 16:21:11 +0000 |
---|---|---|
committer | Arne H Juul <arnej@yahooinc.com> | 2022-02-04 16:23:37 +0000 |
commit | 6f4009bdee8a35ebaef967ce60e8623a5cc7fefd (patch) | |
tree | 253af51a2fbd84c232e48bed84a6ccb81cc7771d /searchsummary | |
parent | 8882668f2eee7547f09cff11ce3d3eefcb56869a (diff) |
add a global variable
Diffstat (limited to 'searchsummary')
-rw-r--r-- | searchsummary/src/vespa/searchsummary/docsummary/resultconfig.cpp | 9 | ||||
-rw-r--r-- | searchsummary/src/vespa/searchsummary/docsummary/resultconfig.h | 2 |
2 files changed, 11 insertions, 0 deletions
diff --git a/searchsummary/src/vespa/searchsummary/docsummary/resultconfig.cpp b/searchsummary/src/vespa/searchsummary/docsummary/resultconfig.cpp index d3c0caeec48..02bb5d25ca4 100644 --- a/searchsummary/src/vespa/searchsummary/docsummary/resultconfig.cpp +++ b/searchsummary/src/vespa/searchsummary/docsummary/resultconfig.cpp @@ -3,6 +3,7 @@ #include "resultconfig.h" #include <vespa/vespalib/util/exceptions.h> #include <vespa/vespalib/stllike/hash_map.hpp> +#include <atomic> #include <vespa/log/log.h> LOG_SETUP(".searchlib.docsummary.resultconfig"); @@ -117,6 +118,13 @@ ResultConfig::CreateEnumMaps() } } +namespace { +std::atomic<bool> global_useV8geoPositions = false; +} + +bool ResultConfig::wantedV8geoPositions() { + return global_useV8geoPositions; +} bool ResultConfig::ReadConfig(const vespa::config::search::SummaryConfig &cfg, const char *configId) @@ -126,6 +134,7 @@ ResultConfig::ReadConfig(const vespa::config::search::SummaryConfig &cfg, const int maxclassID = 0x7fffffff; // avoid negative classids _defaultSummaryId = cfg.defaultsummaryid; _useV8geoPositions = cfg.usev8geopositions; + global_useV8geoPositions = cfg.usev8geopositions; for (uint32_t i = 0; rc && i < cfg.classes.size(); i++) { const auto& cfg_class = cfg.classes[i]; diff --git a/searchsummary/src/vespa/searchsummary/docsummary/resultconfig.h b/searchsummary/src/vespa/searchsummary/docsummary/resultconfig.h index 8a8bfabaaec..8c5895a779d 100644 --- a/searchsummary/src/vespa/searchsummary/docsummary/resultconfig.h +++ b/searchsummary/src/vespa/searchsummary/docsummary/resultconfig.h @@ -173,6 +173,8 @@ public: return false; } + // whether last config seen wanted useV8geoPositions = true + static bool wantedV8geoPositions(); /** * @return the name of the given result field type. |