diff options
author | Håvard Pettersen <havardpe@oath.com> | 2021-10-15 11:56:43 +0000 |
---|---|---|
committer | Håvard Pettersen <havardpe@oath.com> | 2021-10-15 11:57:31 +0000 |
commit | ce77705d044630a1c7256e6b00790b05be55f00a (patch) | |
tree | 7cdb9b4d52a56d05b5d8b6a1f750163e1662c782 /searchlib | |
parent | 0b1564f56523601b9f125a23c578801c46449fcb (diff) |
report more issues from searchlib
Diffstat (limited to 'searchlib')
15 files changed, 57 insertions, 43 deletions
diff --git a/searchlib/src/vespa/searchlib/common/geo_location_parser.cpp b/searchlib/src/vespa/searchlib/common/geo_location_parser.cpp index 5ebce7906b9..8794169b4a6 100644 --- a/searchlib/src/vespa/searchlib/common/geo_location_parser.cpp +++ b/searchlib/src/vespa/searchlib/common/geo_location_parser.cpp @@ -6,6 +6,9 @@ #include <vespa/vespalib/data/slime/slime.h> #include <vespa/vespalib/data/slime/json_format.h> +#include <vespa/vespalib/util/issue.h> +using vespalib::Issue; + #include <vespa/log/log.h> LOG_SETUP(".searchlib.common.geo_location_parser"); @@ -207,9 +210,9 @@ GeoLocationParser::parseJsonFormat(const std::string &str) vespalib::Slime slime; size_t decoded = vespalib::slime::JsonFormat::decode(str, slime); if (decoded == 0) { - LOG(warning, "bad location JSON: %s\n>> %s <<", - slime.get()["error_message"].asString().make_string().c_str(), - str.c_str()); + Issue::report("GeoLocationParser: bad location JSON: %s\n>> %s <<", + slime.get()["error_message"].asString().make_string().c_str(), + str.c_str()); _parseError = "Failed decoding JSON format location"; return false; } diff --git a/searchlib/src/vespa/searchlib/common/sortresults.cpp b/searchlib/src/vespa/searchlib/common/sortresults.cpp index 5895af3b387..7a54de708d0 100644 --- a/searchlib/src/vespa/searchlib/common/sortresults.cpp +++ b/searchlib/src/vespa/searchlib/common/sortresults.cpp @@ -8,6 +8,9 @@ #include <vespa/document/base/globalid.h> #include <vespa/vespalib/util/array.hpp> +#include <vespa/vespalib/util/issue.h> +using vespalib::Issue; + #include <vespa/log/log.h> LOG_SETUP(".search.attribute.sortresults"); @@ -189,7 +192,7 @@ FastS_SortSpec::Add(IAttributeContext & vecMan, const SortInfo & sInfo) } else if ( vector->hasMultiValue()) { err = "multivalued"; } - LOG(warning, "Attribute vector '%s' is %s. Skipped in sorting", sInfo._field.c_str(), err); + Issue::report("sort spec: Attribute vector '%s' is %s. Skipped in sorting", sInfo._field.c_str(), err); return false; } } @@ -322,7 +325,7 @@ FastS_SortSpec::Init(const string & sortStr, IAttributeContext & vecMan) retval = Add(vecMan, *it); } } catch (const std::exception & e) { - LOG(warning, "Failed parsing sortspec: %s", sortStr.c_str()); + Issue::report("Failed parsing sortspec: %s", sortStr.c_str()); return retval; } diff --git a/searchlib/src/vespa/searchlib/features/attributefeature.cpp b/searchlib/src/vespa/searchlib/features/attributefeature.cpp index f6c51f66487..07458743a46 100644 --- a/searchlib/src/vespa/searchlib/features/attributefeature.cpp +++ b/searchlib/src/vespa/searchlib/features/attributefeature.cpp @@ -358,7 +358,7 @@ fef::FeatureExecutor & createAttributeExecutor(uint32_t numOutputs, const IAttributeVector *attribute, const vespalib::string &attrName, const vespalib::string &extraParam, vespalib::Stash &stash) { if (attribute == nullptr) { - Issue::report("The attribute vector '%s' was not found in the attribute manager, returning default values.", + Issue::report("attribute feature: The attribute vector '%s' was not found in the attribute manager, returning default values.", attrName.c_str()); std::vector<feature_t> values(numOutputs, 0.0f); return stash.create<ValueExecutor>(values); @@ -446,25 +446,25 @@ createTensorAttributeExecutor(const IAttributeVector *attribute, const vespalib: vespalib::Stash &stash) { if (attribute == nullptr) { - Issue::report("The attribute vector '%s' was not found in the attribute manager." + Issue::report("attribute feature: The attribute vector '%s' was not found in the attribute manager." " Returning empty tensor.", attrName.c_str()); return ConstantTensorExecutor::createEmpty(tensorType, stash); } if (attribute->getCollectionType() != attribute::CollectionType::SINGLE || attribute->getBasicType() != attribute::BasicType::TENSOR) { - Issue::report("The attribute vector '%s' is NOT of type tensor." + Issue::report("attribute feature: The attribute vector '%s' is NOT of type tensor." "Returning empty tensor.", attribute->getName().c_str()); return ConstantTensorExecutor::createEmpty(tensorType, stash); } const ITensorAttribute *tensorAttribute = attribute->asTensorAttribute(); if (tensorAttribute == nullptr) { - Issue::report("The attribute vector '%s' could not be converted to a tensor attribute." + Issue::report("attribute feature: The attribute vector '%s' could not be converted to a tensor attribute." " Returning empty tensor.", attribute->getName().c_str()); return ConstantTensorExecutor::createEmpty(tensorType, stash); } if (tensorType != tensorAttribute->getTensorType()) { - Issue::report("The tensor attribute '%s' has tensor type '%s'," + Issue::report("attribute feature: The tensor attribute '%s' has tensor type '%s'," " while the feature executor expects type '%s'. Returning empty tensor.", attribute->getName().c_str(), tensorAttribute->getTensorType().to_spec().c_str(), diff --git a/searchlib/src/vespa/searchlib/features/attributematchfeature.cpp b/searchlib/src/vespa/searchlib/features/attributematchfeature.cpp index c0b0bd0e7b0..51af40f19f2 100644 --- a/searchlib/src/vespa/searchlib/features/attributematchfeature.cpp +++ b/searchlib/src/vespa/searchlib/features/attributematchfeature.cpp @@ -10,6 +10,9 @@ #include <vespa/searchcommon/attribute/attributecontent.h> #include <vespa/vespalib/util/stash.h> +#include <vespa/vespalib/util/issue.h> +using vespalib::Issue; + #include <vespa/log/log.h> LOG_SETUP(".features.attributematchfeature"); @@ -339,7 +342,7 @@ AttributeMatchBlueprint::createExecutor(const IQueryEnvironment & env, vespalib: { const IAttributeVector * attribute = env.getAttributeContext().getAttribute(_params.attrInfo->name()); if (attribute == nullptr) { - LOG(error, "The attribute vector '%s' was not found in the attribute manager.", _params.attrInfo->name().c_str()); + Issue::report("attribute_match feature: The attribute vector '%s' was not found in the attribute manager.", _params.attrInfo->name().c_str()); std::vector<feature_t> values; values.push_back(0.0); // completeness values.push_back(0.0); // queryCompleteness diff --git a/searchlib/src/vespa/searchlib/features/distancefeature.cpp b/searchlib/src/vespa/searchlib/features/distancefeature.cpp index e9cb4222a15..d5a27d04216 100644 --- a/searchlib/src/vespa/searchlib/features/distancefeature.cpp +++ b/searchlib/src/vespa/searchlib/features/distancefeature.cpp @@ -283,16 +283,16 @@ DistanceBlueprint::createExecutor(const IQueryEnvironment &env, vespalib::Stash pos = env.getAttributeContext().getAttribute(_arg_string); if (pos != nullptr) { if (!pos->isIntegerType()) { - Issue::report("The position attribute '%s' is not an integer attribute. Will use default distance.", + Issue::report("distance feature: The position attribute '%s' is not an integer attribute. Will use default distance.", pos->getName().c_str()); pos = nullptr; } else if (pos->getCollectionType() == attribute::CollectionType::WSET) { - Issue::report("The position attribute '%s' is a weighted set attribute. Will use default distance.", + Issue::report("distance feature: The position attribute '%s' is a weighted set attribute. Will use default distance.", pos->getName().c_str()); pos = nullptr; } } else { - Issue::report("The position attribute '%s' was not found. Will use default distance.", _arg_string.c_str()); + Issue::report("distance feature: The position attribute '%s' was not found. Will use default distance.", _arg_string.c_str()); } } LOG(debug, "use '%s' locations with pos=%p", matching_locs.empty() ? "other" : "matching", pos); diff --git a/searchlib/src/vespa/searchlib/features/distancetopathfeature.cpp b/searchlib/src/vespa/searchlib/features/distancetopathfeature.cpp index 4153a86d2e2..50c48fd63f2 100644 --- a/searchlib/src/vespa/searchlib/features/distancetopathfeature.cpp +++ b/searchlib/src/vespa/searchlib/features/distancetopathfeature.cpp @@ -156,19 +156,19 @@ DistanceToPathBlueprint::createExecutor(const search::fef::IQueryEnvironment &en } if (pos != nullptr) { if (!pos->isIntegerType()) { - Issue::report("The position attribute '%s' is not an integer attribute. Will use default distance.", + Issue::report("distance_to_path feature: The position attribute '%s' is not an integer attribute. Will use default distance.", pos->getName().c_str()); pos = nullptr; } else if (pos->getCollectionType() == attribute::CollectionType::WSET) { - Issue::report("The position attribute '%s' is a weighted set attribute. Will use default distance.", + Issue::report("distance_to_path feature: The position attribute '%s' is a weighted set attribute. Will use default distance.", pos->getName().c_str()); pos = nullptr; } } else { - Issue::report("The position attribute '%s' was not found. Will use default distance.", _posAttr.c_str()); + Issue::report("distance_to_path feature: The position attribute '%s' was not found. Will use default distance.", _posAttr.c_str()); } } else { - Issue::report("No path given in query. Will use default distance."); + Issue::report("distance_to_path feature: No path given in query. Will use default distance."); } // Create and return a compatible executor. diff --git a/searchlib/src/vespa/searchlib/features/documenttestutils.cpp b/searchlib/src/vespa/searchlib/features/documenttestutils.cpp index 2d1a35c0d13..667fef987b9 100644 --- a/searchlib/src/vespa/searchlib/features/documenttestutils.cpp +++ b/searchlib/src/vespa/searchlib/features/documenttestutils.cpp @@ -12,6 +12,9 @@ #include <cmath> #include <ostream> +#include <vespa/vespalib/util/issue.h> +using vespalib::Issue; + #include <vespa/log/log.h> LOG_SETUP(".features.utils"); using namespace search::fef; @@ -145,8 +148,8 @@ getTermByLabel(const search::fef::IQueryEnvironment &env, const vespalib::string } uint32_t uid = strToNum<uint32_t>(p.get()); if (uid == 0) { - LOG(warning, "Query label '%s' was attached to invalid unique id: '%s'", - label.c_str(), p.get().c_str()); + Issue::report("Query label '%s' was attached to invalid unique id: '%s'", + label.c_str(), p.get().c_str()); return 0; } for (uint32_t i(0), m(env.getNumTerms()); i < m; ++i) { @@ -155,8 +158,8 @@ getTermByLabel(const search::fef::IQueryEnvironment &env, const vespalib::string return term; } } - LOG(warning, "Query label '%s' was attached to non-existing unique id: '%s'", - label.c_str(), p.get().c_str()); + Issue::report("Query label '%s' was attached to non-existing unique id: '%s'", + label.c_str(), p.get().c_str()); return 0; } diff --git a/searchlib/src/vespa/searchlib/features/dotproductfeature.cpp b/searchlib/src/vespa/searchlib/features/dotproductfeature.cpp index f92c94e0c80..4a32f1b7078 100644 --- a/searchlib/src/vespa/searchlib/features/dotproductfeature.cpp +++ b/searchlib/src/vespa/searchlib/features/dotproductfeature.cpp @@ -509,10 +509,10 @@ ArrayParam<T>::ArrayParam(vespalib::nbostream & stream) { TypedCells cells = tensor->cells(); typify_invoke<1,TypifyCellType,CopyCellsToVector<T>>(cells.type, cells, values); } else { - Issue::report("Expected dense tensor, but got type '%s'", tensor->type().to_spec().c_str()); + Issue::report("dot_product feature: Expected dense tensor, but got type '%s'", tensor->type().to_spec().c_str()); } } catch (const vespalib::eval::DecodeValueException &e) { - Issue::report("Failed to decode tensor: %s", e.what()); + Issue::report("dot_product feature: Failed to decode tensor: %s", e.what()); } } @@ -775,7 +775,7 @@ createFromObject(const IAttributeVector * attribute, const fef::Anything & objec } // TODO: Add support for creating executor for weighted set string / integer attribute // where the query vector is represented as an object instead of a string. - Issue::report("The attribute vector '%s' is NOT of type array<int/long/float/double>" + Issue::report("dot_product feature: The attribute vector '%s' is NOT of type array<int/long/float/double>" ", returning executor with default value.", attribute->getName().c_str()); return stash.create<SingleZeroValueExecutor>(); } @@ -882,7 +882,7 @@ createFromString(const IAttributeVector * attribute, const Property & prop, vesp } if (executor == nullptr) { - Issue::report("The attribute vector '%s' is not of type weighted set string/integer nor" + Issue::report("dot_product feature: The attribute vector '%s' is not of type weighted set string/integer nor" " array<int/long/float/double>, returning executor with default value.", attribute->getName().c_str()); executor = &stash.create<SingleZeroValueExecutor>(); } @@ -1109,7 +1109,7 @@ DotProductBlueprint::createExecutor(const IQueryEnvironment & env, vespalib::Sta attribute = upgradeIfNecessary(attribute, env); } if (attribute == nullptr) { - Issue::report("The attribute vector '%s' was not found in the attribute manager, returning executor with default value.", + Issue::report("dot_product feature: The attribute vector '%s' was not found in the attribute manager, returning executor with default value.", getAttribute(env).c_str()); return stash.create<SingleZeroValueExecutor>(); } diff --git a/searchlib/src/vespa/searchlib/features/euclidean_distance_feature.cpp b/searchlib/src/vespa/searchlib/features/euclidean_distance_feature.cpp index f3640f38441..d41bff62baa 100644 --- a/searchlib/src/vespa/searchlib/features/euclidean_distance_feature.cpp +++ b/searchlib/src/vespa/searchlib/features/euclidean_distance_feature.cpp @@ -99,7 +99,7 @@ EuclideanDistanceBlueprint::createExecutor(const IQueryEnvironment &env, vespali { const IAttributeVector * attribute = env.getAttributeContext().getAttribute(_attributeName); if (attribute == nullptr) { - Issue::report("The attribute vector '%s' was not found in the attribute manager, returning executor with default value.", + Issue::report("euclidean_distance feature: The attribute vector '%s' was not found in the attribute manager, returning executor with default value.", _attributeName.c_str()); return stash.create<SingleZeroValueExecutor>(); } @@ -113,7 +113,7 @@ EuclideanDistanceBlueprint::createExecutor(const IQueryEnvironment &env, vespali return create<double>(*attribute, queryVector, stash); } } - Issue::report("The attribute vector '%s' is NOT of type array<int/long/float/double>" + Issue::report("euclidean_distance feature: The attribute vector '%s' is NOT of type array<int/long/float/double>" ", returning executor with default value.", attribute->getName().c_str()); return stash.create<SingleZeroValueExecutor>(); diff --git a/searchlib/src/vespa/searchlib/features/internal_max_reduce_prod_join_feature.cpp b/searchlib/src/vespa/searchlib/features/internal_max_reduce_prod_join_feature.cpp index aacb9c03012..2a326583078 100644 --- a/searchlib/src/vespa/searchlib/features/internal_max_reduce_prod_join_feature.cpp +++ b/searchlib/src/vespa/searchlib/features/internal_max_reduce_prod_join_feature.cpp @@ -170,7 +170,7 @@ selectExecutor(const IAttributeVector *attribute, V && vector, vespalib::Stash & break; } } - Issue::report("The attribute vector '%s' is not of type " + Issue::report("intrinsic max_reduce_prod_join feature: The attribute vector '%s' is not of type " "array<int/long>, returning executor with default value.", attribute->getName().c_str()); return stash.create<SingleZeroValueExecutor>(); } @@ -255,7 +255,7 @@ InternalMaxReduceProdJoinBlueprint::createExecutor(const IQueryEnvironment &env, { const IAttributeVector * attribute = lookupAttribute(_attrKey, _attribute, env); if (attribute == nullptr) { - Issue::report("The attribute vector '%s' was not found in the attribute manager, " + Issue::report("intrinsic max_reduce_prod_join feature: The attribute vector '%s' was not found in the attribute manager, " "returning executor with default value.", _attribute.c_str()); return stash.create<SingleZeroValueExecutor>(); } diff --git a/searchlib/src/vespa/searchlib/features/tensor_from_labels_feature.cpp b/searchlib/src/vespa/searchlib/features/tensor_from_labels_feature.cpp index 85b841e2cac..bbae87b2240 100644 --- a/searchlib/src/vespa/searchlib/features/tensor_from_labels_feature.cpp +++ b/searchlib/src/vespa/searchlib/features/tensor_from_labels_feature.cpp @@ -61,17 +61,17 @@ createAttributeExecutor(const search::fef::IQueryEnvironment &env, { const IAttributeVector *attribute = env.getAttributeContext().getAttribute(attrName); if (attribute == NULL) { - Issue::report("The attribute vector '%s' was not found in the attribute manager." + Issue::report("tensor_from_labels feature: The attribute vector '%s' was not found in the attribute manager." " Returning empty tensor.", attrName.c_str()); return ConstantTensorExecutor::createEmpty(ValueType::make_type(CellType::DOUBLE, {{dimension}}), stash); } if (attribute->isFloatingPointType()) { - Issue::report("The attribute vector '%s' must have basic type string or integer." + Issue::report("tensor_from_labels feature: The attribute vector '%s' must have basic type string or integer." " Returning empty tensor.", attrName.c_str()); return ConstantTensorExecutor::createEmpty(ValueType::make_type(CellType::DOUBLE, {{dimension}}), stash); } if (attribute->getCollectionType() == search::attribute::CollectionType::WSET) { - Issue::report("The attribute vector '%s' is a weighted set - use tensorFromWeightedSet instead." + Issue::report("tensor_from_labels feature: The attribute vector '%s' is a weighted set - use tensorFromWeightedSet instead." " Returning empty tensor.", attrName.c_str()); return ConstantTensorExecutor::createEmpty(ValueType::make_type(CellType::DOUBLE, {{dimension}}), stash); } diff --git a/searchlib/src/vespa/searchlib/features/tensor_from_weighted_set_feature.cpp b/searchlib/src/vespa/searchlib/features/tensor_from_weighted_set_feature.cpp index 96efc575b21..9db9f4616e3 100644 --- a/searchlib/src/vespa/searchlib/features/tensor_from_weighted_set_feature.cpp +++ b/searchlib/src/vespa/searchlib/features/tensor_from_weighted_set_feature.cpp @@ -75,14 +75,14 @@ createAttributeExecutor(const search::fef::IQueryEnvironment &env, { const IAttributeVector *attribute = env.getAttributeContext().getAttribute(attrName); if (attribute == NULL) { - Issue::report("The attribute vector '%s' was not found in the attribute manager." + Issue::report("tensor_from_weighted_set feature: The attribute vector '%s' was not found in the attribute manager." " Returning empty tensor.", attrName.c_str()); return ConstantTensorExecutor::createEmpty(ValueType::make_type(CellType::DOUBLE, {{dimension}}), stash); } if (attribute->getCollectionType() != search::attribute::CollectionType::WSET || attribute->isFloatingPointType()) { - Issue::report("The attribute vector '%s' is NOT of type weighted set of string or integer." + Issue::report("tensor_from_weighted_set feature: The attribute vector '%s' is NOT of type weighted set of string or integer." " Returning empty tensor.", attrName.c_str()); return ConstantTensorExecutor::createEmpty(ValueType::make_type(CellType::DOUBLE, {{dimension}}), stash); } diff --git a/searchlib/src/vespa/searchlib/features/weighted_set_parser.hpp b/searchlib/src/vespa/searchlib/features/weighted_set_parser.hpp index d6fd057eb54..3918c434956 100644 --- a/searchlib/src/vespa/searchlib/features/weighted_set_parser.hpp +++ b/searchlib/src/vespa/searchlib/features/weighted_set_parser.hpp @@ -29,7 +29,7 @@ WeightedSetParser::parse(const vespalib::string &input, OutputType &output) vespalib::stringref value(item.substr(colonPos+1)); output.insert(key, value); } else { - Issue::report("Could not parse item '%s' in input string '%s', skipping. " + Issue::report("weighted set parser: Could not parse item '%s' in input string '%s', skipping. " "Expected ':' between key and weight.", vespalib::string(item).c_str(), input.c_str()); } if (commaPos != vespalib::string::npos) { @@ -39,7 +39,7 @@ WeightedSetParser::parse(const vespalib::string &input, OutputType &output) } } } else { - Issue::report("Could not parse input string '%s'. " + Issue::report("weighted set parser: Could not parse input string '%s'. " "Expected surrounding '(' and ')' or '{' and '}'.", input.c_str()); } } diff --git a/searchlib/src/vespa/searchlib/predicate/predicate_range_term_expander.h b/searchlib/src/vespa/searchlib/predicate/predicate_range_term_expander.h index c6720ee1db2..e0386dc4b44 100644 --- a/searchlib/src/vespa/searchlib/predicate/predicate_range_term_expander.h +++ b/searchlib/src/vespa/searchlib/predicate/predicate_range_term_expander.h @@ -3,6 +3,7 @@ #pragma once #include <vespa/vespalib/stllike/string.h> +#include <vespa/vespalib/util/issue.h> #include <climits> namespace search::predicate { @@ -44,7 +45,7 @@ public: template <typename Handler> void PredicateRangeTermExpander::expand(const vespalib::string &key, int64_t signed_value, Handler &handler) { if (signed_value < _lower_bound || signed_value > _upper_bound) { - LOG(warning, "Search outside bounds should have been rejected by ValidatePredicateSearcher."); + vespalib::Issue::report("predicate_range_term_expander: Search outside bounds should have been rejected by ValidatePredicateSearcher."); return; } char buffer[21 * 2 + 3 + key.size()]; // 2 numbers + punctuation + key diff --git a/searchlib/src/vespa/searchlib/query/tree/stackdumpquerycreator.h b/searchlib/src/vespa/searchlib/query/tree/stackdumpquerycreator.h index 63866a24eec..f8254186900 100644 --- a/searchlib/src/vespa/searchlib/query/tree/stackdumpquerycreator.h +++ b/searchlib/src/vespa/searchlib/query/tree/stackdumpquerycreator.h @@ -9,6 +9,7 @@ #include <vespa/searchlib/common/geo_location_parser.h> #include <vespa/vespalib/objects/hexdump.h> #include <vespa/vespalib/util/stringfmt.h> +#include <vespa/vespalib/util/issue.h> #include <charconv> namespace search::query { @@ -40,9 +41,9 @@ public: } if (builder.hasError()) { vespalib::stringref stack = queryStack.getStack(); - LOG(error, "Unable to create query tree from stack dump. Failed at position %ld out of %ld bytes %s", + vespalib::Issue::report("Unable to create query tree from stack dump. Failed at position %ld out of %ld bytes %s", queryStack.getPosition(), stack.size(), builder.error().c_str()); - LOG(error, "Raw QueryStack = %s", vespalib::HexDump(stack.data(), stack.size()).toString().c_str()); + LOG(error, "got bad query stack: %s", vespalib::HexDump(stack.data(), stack.size()).toString().c_str()); } return builder.build(); } @@ -177,7 +178,7 @@ private: } else if (type == ParseItem::ITEM_GEO_LOCATION_TERM) { search::common::GeoLocationParser parser; if (! parser.parseNoField(term)) { - LOG(warning, "invalid geo location term '%s'", term.data()); + vespalib::Issue::report("query builder: invalid geo location term '%s'", term.data()); } Location loc(parser.getGeoLocation()); t = &builder.addLocationTerm(loc, view, id, weight); @@ -193,7 +194,7 @@ private: } else if (type == ParseItem::ITEM_REGEXP) { t = &builder.addRegExpTerm(term, view, id, weight); } else { - LOG(error, "Unable to create query tree from stack dump. node type = %d.", type); + vespalib::Issue::report("query builder: Unable to create query tree from stack dump. node type = %d.", type); } } return t; |