diff options
author | Henning Baldersheim <balder@yahoo-inc.com> | 2022-04-19 14:33:35 +0000 |
---|---|---|
committer | Henning Baldersheim <balder@yahoo-inc.com> | 2022-04-19 14:33:35 +0000 |
commit | 9cc5579fd79271616cef7ea3f22f196a0295d651 (patch) | |
tree | bc052760a5b792a1084a6a48f34c3800da50c60f /searchcore | |
parent | c1930c80780b6630ee553fecff71c5e7ae19f1ce (diff) |
Also provide number of matchers and name of the matchers available.
Diffstat (limited to 'searchcore')
3 files changed, 17 insertions, 3 deletions
diff --git a/searchcore/src/vespa/searchcore/proton/server/matchers.cpp b/searchcore/src/vespa/searchcore/proton/server/matchers.cpp index 9ed9b45c1bd..62ae7774daf 100644 --- a/searchcore/src/vespa/searchcore/proton/server/matchers.cpp +++ b/searchcore/src/vespa/searchcore/proton/server/matchers.cpp @@ -57,4 +57,14 @@ Matchers::lookup(const vespalib::string &name) const //TODO add warning log message when not found, may want to use "_fallback" in most cases here } +vespalib::string +Matchers::listMatchers() const { + vespalib::string matchers; + for (const auto & entry : _rpmap) { + matchers += entry.first; + matchers += ' '; + } + return matchers; +} + } // namespace proton diff --git a/searchcore/src/vespa/searchcore/proton/server/matchers.h b/searchcore/src/vespa/searchcore/proton/server/matchers.h index b9c47da4c3e..fe467c1f565 100644 --- a/searchcore/src/vespa/searchcore/proton/server/matchers.h +++ b/searchcore/src/vespa/searchcore/proton/server/matchers.h @@ -17,7 +17,7 @@ namespace matching { class Matchers { private: - typedef vespalib::hash_map<vespalib::string, std::shared_ptr<matching::Matcher>> Map; + using Map = vespalib::hash_map<vespalib::string, std::shared_ptr<matching::Matcher>>; Map _rpmap; std::shared_ptr<matching::Matcher> _fallback; std::shared_ptr<matching::Matcher> _default; @@ -27,11 +27,15 @@ public: Matchers(const vespalib::Clock &clock, matching::QueryLimiter &queryLimiter, const matching::IConstantValueRepo &constantValueRepo); + Matchers(const Matchers &) = delete; + Matchers & operator =(const Matchers &) = delete; ~Matchers(); void add(const vespalib::string &name, std::shared_ptr<matching::Matcher> matcher); matching::MatchingStats getStats() const; matching::MatchingStats getStats(const vespalib::string &name) const; std::shared_ptr<matching::Matcher> lookup(const vespalib::string &name) const; + vespalib::string listMatchers() const; + uint32_t numMatchers() const { return _rpmap.size(); } }; } // namespace proton diff --git a/searchcore/src/vespa/searchcore/proton/server/matchview.cpp b/searchcore/src/vespa/searchcore/proton/server/matchview.cpp index acd8c65791c..210de685472 100644 --- a/searchcore/src/vespa/searchcore/proton/server/matchview.cpp +++ b/searchcore/src/vespa/searchcore/proton/server/matchview.cpp @@ -54,8 +54,8 @@ MatchView::getMatcher(const vespalib::string & rankProfile) const { Matcher::SP retval = _matchers->lookup(rankProfile); if ( ! retval) { - throw IllegalArgumentException(fmt("Failed locating Matcher for rank profile '%s' docIdLimit=%d", - rankProfile.c_str(), _docIdLimit.get()), VESPA_STRLOC); + throw IllegalArgumentException(fmt("Failed locating Matcher for rank profile '%s' docIdLimit=%d num_matchers=%d matchers='%s'", + rankProfile.c_str(), _docIdLimit.get(), _matchers->numMatchers(), _matchers->listMatchers().c_str()), VESPA_STRLOC); } LOG(debug, "Rankprofile = %s has termwise_limit=%f", rankProfile.c_str(), retval->get_termwise_limit()); return retval; |