diff --git a/streamingvisitors/src/vespa/searchvisitor/queryenvironment.cpp b/streamingvisitors/src/vespa/searchvisitor/queryenvironment.cpp index 055af602b179..c8aa2bbdfde4 100644 --- a/streamingvisitors/src/vespa/searchvisitor/queryenvironment.cpp +++ b/streamingvisitors/src/vespa/searchvisitor/queryenvironment.cpp @@ -4,6 +4,7 @@ #include #include #include +#include #include LOG_SETUP(".searchvisitor.queryenvironment"); @@ -13,6 +14,7 @@ using search::common::GeoLocationParser; using search::common::GeoLocationSpec; using search::fef::Properties; using std::string; +using vespalib::Issue; namespace streaming { @@ -27,8 +29,8 @@ parseLocation(const string & location_str) } GeoLocationParser locationParser; if (!locationParser.parseWithField(location_str)) { - LOG(warning, "Location parse error (location: '%s'): %s. Location ignored.", - location_str.c_str(), locationParser.getParseError()); + Issue::report("Location parse error (location: '%s'): %s. Location ignored.", + location_str.c_str(), locationParser.getParseError()); return fefLocations; } auto loc = locationParser.getGeoLocation(); @@ -57,8 +59,8 @@ QueryEnvironment::~QueryEnvironment() {} void QueryEnvironment::addGeoLocation(const std::string &field, const std::string &location_str) { GeoLocationParser locationParser; if (! locationParser.parseNoField(location_str)) { - LOG(warning, "Location parse error (location: '%s'): %s. Location ignored.", - location_str.c_str(), locationParser.getParseError()); + Issue::report("Location parse error (location: '%s'): %s. Location ignored.", + location_str.c_str(), locationParser.getParseError()); return; } auto loc = locationParser.getGeoLocation(); diff --git a/streamingvisitors/src/vespa/searchvisitor/rankprocessor.cpp b/streamingvisitors/src/vespa/searchvisitor/rankprocessor.cpp index e46cf9e663b4..64b076f3b5a2 100644 --- a/streamingvisitors/src/vespa/searchvisitor/rankprocessor.cpp +++ b/streamingvisitors/src/vespa/searchvisitor/rankprocessor.cpp @@ -8,6 +8,7 @@ #include #include #include +#include #include #include #include @@ -32,6 +33,7 @@ using search::streaming::MultiTerm; using search::streaming::Query; using search::streaming::QueryTerm; using search::streaming::QueryTermList; +using vespalib::Issue; using vdslib::SearchResult; namespace streaming { @@ -68,8 +70,8 @@ RankProcessor::resolve_fields_from_children(QueryTermData& qtd, const MultiTerm& field_ids.insert(field_id); } } else { - LOG(warning, "Could not find a view for index '%s'. Ranking no fields.", - getIndexName(subterm->index(), expandedIndexName).c_str()); + Issue::report("Could not find a view for index '%s'. Ranking no fields.", + getIndexName(subterm->index(), expandedIndexName).c_str()); } } std::vector sorted_field_ids; @@ -93,8 +95,8 @@ RankProcessor::resolve_fields_from_term(QueryTermData& qtd, const search::stream qtd.getTermData().addField(field_id).setHandle(_mdLayout.allocTermField(field_id)); } } else { - LOG(warning, "Could not find a view for index '%s'. Ranking no fields.", - getIndexName(term.index(), expandedIndexName).c_str()); + Issue::report("Could not find a view for index '%s'. Ranking no fields.", + getIndexName(term.index(), expandedIndexName).c_str()); } LOG(debug, "Setup query term '%s:%s'", getIndexName(term.index(), expandedIndexName).c_str(), diff --git a/streamingvisitors/src/vespa/searchvisitor/searchvisitor.cpp b/streamingvisitors/src/vespa/searchvisitor/searchvisitor.cpp index c7110b9370bb..60ce9f807b2d 100644 --- a/streamingvisitors/src/vespa/searchvisitor/searchvisitor.cpp +++ b/streamingvisitors/src/vespa/searchvisitor/searchvisitor.cpp @@ -450,7 +450,7 @@ SearchVisitor::init(const Parameters & params) for (uint32_t i = 0; i < cnt; ++i) { search::fs4transport::FS4Properties prop; if (!prop.decode(src, len)) { - LOG(warning, "Could not decode rank properties"); + Issue::report("Could not decode rank properties"); } else { LOG(debug, "Properties[%u]: name '%s', size '%u'", i, prop.name().c_str(), prop.size()); if (prop.name() == "rank") { // pick up rank properties @@ -516,7 +516,7 @@ SearchVisitor::init(const Parameters & params) if (params.get("querystackcount", stackCount)) { _summaryGenerator.set_stack_dump(std::vector(queryBlob.begin(), queryBlob.end())); } else { - LOG(warning, "Request without query stack count"); + Issue::report("Request without query stack count"); } StringFieldIdTMap fieldsInQuery = setupFieldSearchers(); @@ -540,7 +540,7 @@ SearchVisitor::init(const Parameters & params) // and IQueryEnvironment (from setupRankProcessors). prepare_field_searchers(); } else { - LOG(warning, "No query received"); + Issue::report("No query received"); } if (hasGrouping) { @@ -552,7 +552,7 @@ SearchVisitor::init(const Parameters & params) } } else { - LOG(warning, "No searchcluster specified"); + Issue::report("No searchcluster specified"); } if ( params.lookup("unique", valueRef) ) { @@ -674,13 +674,13 @@ SearchVisitor::RankController::processAccessedAttributes(const QueryEnvironment LOG(debug, "Add attribute '%s' with field id '%u' to the list of needed attributes", name.c_str(), fid); attributeFields.emplace_back(fid, std::move(attr)); } else { - LOG(warning, "Cannot locate attribute '%s' in the attribute manager. " - "Ignore access hint about this attribute", name.c_str()); + Issue::report("Cannot locate attribute '%s' in the attribute manager. " + "Ignore access hint about this attribute", name.c_str()); } } } else { - LOG(warning, "Cannot locate field '%s' in the index environment. Ignore access hint about this attribute", - name.c_str()); + Issue::report("Cannot locate field '%s' in the index environment. Ignore access hint about this attribute", + name.c_str()); } } } @@ -902,8 +902,8 @@ SearchVisitor::setupScratchDocument(const StringFieldIdTMap & fieldsInQuery) } // Setup document type mapping if (_fieldSearchSpecMap.documentTypeMap().size() != 1) { - LOG(warning, "We have %zd document types in the vsmfields config when we expected 1. Using the first one", - _fieldSearchSpecMap.documentTypeMap().size()); + Issue::report("We have %zd document types in the vsmfields config when we expected 1. Using the first one", + _fieldSearchSpecMap.documentTypeMap().size()); } _fieldsUnion = fieldsInQuery.map(); for(const auto & entry : _fieldSearchSpecMap.nameIdMap().map()) { @@ -930,7 +930,7 @@ SearchVisitor::setupDocsumObjects() if (docsum_tools) { _summaryGenerator.setDocsumWriter(*docsum_tools->getDocsumWriter()); } else { - LOG(warning, "No docsum tools available"); + Issue::report("No docsum tools available"); } } @@ -977,8 +977,8 @@ void SearchVisitor::setupAttributeVector(const FieldPath &fieldPath) { LOG(debug, "Adding attribute '%s' for field '%s' with data type '%s' (%s)", attr->getName().c_str(), attrName.c_str(), fv.getDataType()->getName().c_str(), fv.className()); if ( ! _attrMan.add(attr) ) { - LOG(warning, "Failed adding attribute '%s' for field '%s' with data type '%s' (%s)", - attr->getName().c_str(), attrName.c_str(), fv.getDataType()->getName().c_str(), fv.className()); + Issue::report("Failed adding attribute '%s' for field '%s' with data type '%s' (%s)", + attr->getName().c_str(), attrName.c_str(), fv.getDataType()->getName().c_str(), fv.className()); } } else { LOG(debug, "Cannot setup attribute for field '%s' with data type '%s' (%s). Aggregation and sorting will not work for this field", @@ -1060,12 +1060,12 @@ SearchVisitor::setupGrouping(const std::vector & groupingBlob) if (!grouping.getAll() || (preparator.getNumHitsAggregators() == 0)) { _groupingList.push_back(groupingPtr); } else { - LOG(warning, "You can not collect hits with an all aggregator yet."); + Issue::report("You can not collect hits with an all aggregator yet."); } } catch (const document::FieldNotFoundException & e) { - LOG(warning, "Could not locate field for grouping number %ld : %s", i, e.getMessage().c_str()); + Issue::report("Could not locate field for grouping number %ld : %s", i, e.getMessage().c_str()); } catch (const std::exception & e) { - LOG(error, "Unknown issue for grouping number %ld : %s", i, e.what()); + Issue::report("Unknown issue for grouping number %ld : %s", i, e.what()); } } } @@ -1118,8 +1118,8 @@ SearchVisitor::handleDocuments(const document::BucketId&, DocEntryList & entries handleDocument(document); } } catch (const std::exception & e) { - LOG(warning, "Caught exception handling document '%s'. Exception='%s'", - document->docDoc().getId().getScheme().toString().c_str(), e.what()); + Issue::report("Caught exception handling document '%s'. Exception='%s'", + document->docDoc().getId().getScheme().toString().c_str(), e.what()); } } } diff --git a/streamingvisitors/src/vespa/vsm/common/documenttypemapping.cpp b/streamingvisitors/src/vespa/vsm/common/documenttypemapping.cpp index 2853f0fb7e63..1657bfcb8b2e 100644 --- a/streamingvisitors/src/vespa/vsm/common/documenttypemapping.cpp +++ b/streamingvisitors/src/vespa/vsm/common/documenttypemapping.cpp @@ -4,10 +4,13 @@ #include #include #include +#include #include LOG_SETUP(".vsm.common.documenttypemapping"); +using vespalib::Issue; + namespace vsm { DocumentTypeMapping::DocumentTypeMapping() : @@ -49,8 +52,8 @@ bool DocumentTypeMapping::prepareBaseDoc(SharedFieldPathMap & map) const LOG(debug, "Found FieldPathMap for default document type '%s' with %zd elements", _defaultDocumentTypeName.c_str(), map->size()); } else { - LOG(warning, "No FieldPathMap found for default document type '%s'. Using empty one", - _defaultDocumentTypeName.c_str()); + Issue::report("No FieldPathMap found for default document type '%s'. Using empty one", + _defaultDocumentTypeName.c_str()); map = std::make_shared(); } return true; diff --git a/streamingvisitors/src/vespa/vsm/vsm/docsumfilter.cpp b/streamingvisitors/src/vespa/vsm/vsm/docsumfilter.cpp index a51423dc2f3e..0c109b61e0b1 100644 --- a/streamingvisitors/src/vespa/vsm/vsm/docsumfilter.cpp +++ b/streamingvisitors/src/vespa/vsm/vsm/docsumfilter.cpp @@ -11,6 +11,7 @@ #include #include #include +#include #include #include @@ -20,6 +21,8 @@ using namespace search::docsummary; using document::FieldPathEntry; using FieldMap = vsm::StringFieldIdTMap; +using vespalib::Issue; + namespace vsm { namespace { @@ -80,11 +83,11 @@ prepareFieldSpec(DocsumFieldSpec & spec, const DocsumTools::FieldSpec & toolsSpe spec.set_struct_or_multivalue(true); } } else { - LOG(warning, "Could not find a field path for field '%s' with id '%d'", name.c_str(), field); + Issue::report("Could not find a field path for field '%s' with id '%d'", name.c_str(), field); spec.setOutputField(DocsumFieldSpec::FieldIdentifier(field, FieldPath())); } } else { - LOG(warning, "Could not find output summary field '%s'", name.c_str()); + Issue::report("Could not find output summary field '%s'", name.c_str()); } } // setup input fields @@ -100,11 +103,11 @@ prepareFieldSpec(DocsumFieldSpec & spec, const DocsumTools::FieldSpec & toolsSpe LOG(debug, "field %u < map size %zu", field, fieldPathMap.size()); spec.getInputFields().push_back(DocsumFieldSpec::FieldIdentifier(field, copyPathButFirst(fieldPathMap[field]))); } else { - LOG(warning, "Could not find a field path for field '%s' with id '%d'", name.c_str(), field); + Issue::report("Could not find a field path for field '%s' with id '%d'", name.c_str(), field); spec.getInputFields().push_back(DocsumFieldSpec::FieldIdentifier(field, FieldPath())); } } else { - LOG(warning, "Could not find input summary field '%s'", name.c_str()); + Issue::report("Could not find input summary field '%s'", name.c_str()); } SlimeFillerFilter::add_remaining(filter, name); } diff --git a/streamingvisitors/src/vespa/vsm/vsm/fieldsearchspec.cpp b/streamingvisitors/src/vespa/vsm/vsm/fieldsearchspec.cpp index b7454a65be8f..979e6e511a91 100644 --- a/streamingvisitors/src/vespa/vsm/vsm/fieldsearchspec.cpp +++ b/streamingvisitors/src/vespa/vsm/vsm/fieldsearchspec.cpp @@ -5,6 +5,7 @@ #include #include #include +#include #include #include #include @@ -24,6 +25,7 @@ LOG_SETUP(".vsm.fieldsearchspec"); using search::streaming::ConstQueryTermList; using search::streaming::Query; using search::streaming::QueryTerm; +using vespalib::Issue; namespace vsm { @@ -73,7 +75,7 @@ FieldSearchSpec::FieldSearchSpec(const FieldIdT & fid, const std::string & fname { switch(searchDef) { default: - LOG(warning, "Unknown searchdef = %d. Defaulting to AUTOUTF8", static_cast(searchDef)); + Issue::report("Unknown searchdef = %d. Defaulting to AUTOUTF8", static_cast(searchDef)); [[fallthrough]]; case VsmfieldsConfig::Fieldspec::Searchmethod::AUTOUTF8: case VsmfieldsConfig::Fieldspec::Searchmethod::NONE: @@ -211,7 +213,7 @@ FieldSearchSpecMap::addFieldsFromIndex(std::string_view rawIndex, StringFieldIdT } } } else { - LOG(warning, "No valid indexes registered for index %s", std::string(rawIndex).c_str()); + Issue::report("No valid indexes registered for index %s", std::string(rawIndex).c_str()); } } } @@ -265,7 +267,7 @@ buildFieldSet(const VsmfieldsConfig::Documenttype::Index & ci, const FieldSearch if (foundField != specMap.end()) { ifm.push_back(foundField->second.id()); } else { - LOG(warning, "Field %s not defined. Ignoring....", cf.name.c_str()); + Issue::report("Field %s not defined. Ignoring....", cf.name.c_str()); } } }