// Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. #include "querytermcountfeature.h" #include "valuefeature.h" #include #include #include #include #include using namespace search::fef; namespace search::features { QueryTermCountBlueprint::QueryTermCountBlueprint() : Blueprint("queryTermCount") { } void QueryTermCountBlueprint::visitDumpFeatures(const IIndexEnvironment & env, IDumpFeatureVisitor & visitor) const { (void) env; visitor.visitDumpFeature(getBaseName()); } Blueprint::UP QueryTermCountBlueprint::createInstance() const { return std::make_unique(); } bool QueryTermCountBlueprint::setup(const IIndexEnvironment &, const ParameterList &) { describeOutput("out", "The number of query terms found in the query environment."); return true; } FeatureExecutor & QueryTermCountBlueprint::createExecutor(const IQueryEnvironment &env, vespalib::Stash &stash) const { return stash.create(env.getNumTerms()); } }