diff options
Diffstat (limited to 'searchlib/src')
137 files changed, 251 insertions, 275 deletions
diff --git a/searchlib/src/tests/attribute/attribute_test.cpp b/searchlib/src/tests/attribute/attribute_test.cpp index e13c419e68e..b406afa7e7b 100644 --- a/searchlib/src/tests/attribute/attribute_test.cpp +++ b/searchlib/src/tests/attribute/attribute_test.cpp @@ -459,6 +459,7 @@ void AttributeTest::testReload(const AttributePtr & a, const AttributePtr & b, c (*(static_cast<VectorType *>(a.get())), *(static_cast<VectorType *>(b.get()))); a->setCreateSerialNum(43u); EXPECT_TRUE( a->saveAs(b->getBaseFileName()) ); + a->commit(true); if (preciseEstimatedSize(*a)) { EXPECT_EQUAL(statSize(*b), a->getEstimatedSaveByteSize()); } else { diff --git a/searchlib/src/tests/features/item_raw_score/item_raw_score_test.cpp b/searchlib/src/tests/features/item_raw_score/item_raw_score_test.cpp index f407aea811b..a954710f153 100644 --- a/searchlib/src/tests/features/item_raw_score/item_raw_score_test.cpp +++ b/searchlib/src/tests/features/item_raw_score/item_raw_score_test.cpp @@ -67,13 +67,14 @@ struct SingleLabel : public Labels { struct RankFixture : BlueprintFactoryFixture, IndexFixture { QueryEnvironment queryEnv; RankSetup rankSetup; - RankProgram::UP rankProgram; MatchDataLayout mdl; + MatchData::UP match_data; + RankProgram::UP rankProgram; std::vector<TermFieldHandle> fooHandles; std::vector<TermFieldHandle> barHandles; RankFixture(size_t fooCnt, size_t barCnt, const Labels &labels) : queryEnv(&indexEnv), rankSetup(factory, indexEnv), - rankProgram(), mdl(), fooHandles(), barHandles() + mdl(), match_data(), rankProgram(), fooHandles(), barHandles() { for (size_t i = 0; i < fooCnt; ++i) { uint32_t fieldId = indexEnv.getFieldByName("foo")->id(); @@ -95,14 +96,15 @@ struct RankFixture : BlueprintFactoryFixture, IndexFixture { rankSetup.setFirstPhaseRank(featureName); rankSetup.setIgnoreDefaultRankFeatures(true); ASSERT_TRUE(rankSetup.compile()); + match_data = mdl.createMatchData(); rankProgram = rankSetup.create_first_phase_program(); - rankProgram->setup(mdl, queryEnv); + rankProgram->setup(*match_data, queryEnv); } feature_t getScore(uint32_t docId) { return Utils::getScoreFeature(*rankProgram, docId); } void setScore(TermFieldHandle handle, uint32_t docId, feature_t score) { - rankProgram->match_data().resolveTermField(handle)->setRawScore(docId, score); + match_data->resolveTermField(handle)->setRawScore(docId, score); } void setFooScore(uint32_t i, uint32_t docId, feature_t score) { ASSERT_LESS(i, fooHandles.size()); diff --git a/searchlib/src/tests/features/native_dot_product/native_dot_product_test.cpp b/searchlib/src/tests/features/native_dot_product/native_dot_product_test.cpp index 5ba7504f7d2..1da912ccb3a 100644 --- a/searchlib/src/tests/features/native_dot_product/native_dot_product_test.cpp +++ b/searchlib/src/tests/features/native_dot_product/native_dot_product_test.cpp @@ -72,14 +72,15 @@ std::vector<uint32_t> vec(uint32_t w1, uint32_t w2, uint32_t w3) { struct RankFixture : BlueprintFactoryFixture, IndexFixture { QueryEnvironment queryEnv; RankSetup rankSetup; - RankProgram::UP rankProgram; MatchDataLayout mdl; + MatchData::UP match_data; + RankProgram::UP rankProgram; std::vector<TermFieldHandle> fooHandles; std::vector<TermFieldHandle> barHandles; RankFixture(const std::vector<uint32_t> &fooWeights, const std::vector<uint32_t> &barWeights) : queryEnv(&indexEnv), rankSetup(factory, indexEnv), - rankProgram(), mdl(), fooHandles(), barHandles() + mdl(), match_data(), rankProgram(), fooHandles(), barHandles() { for (size_t i = 0; i < fooWeights.size(); ++i) { uint32_t fieldId = indexEnv.getFieldByName("foo")->id(); @@ -100,8 +101,9 @@ struct RankFixture : BlueprintFactoryFixture, IndexFixture { rankSetup.setFirstPhaseRank(featureName); rankSetup.setIgnoreDefaultRankFeatures(true); ASSERT_TRUE(rankSetup.compile()); + match_data = mdl.createMatchData(); rankProgram = rankSetup.create_first_phase_program(); - rankProgram->setup(mdl, queryEnv); + rankProgram->setup(*match_data, queryEnv); } feature_t getScore(uint32_t docId) { return Utils::getScoreFeature(*rankProgram, docId); @@ -110,15 +112,15 @@ struct RankFixture : BlueprintFactoryFixture, IndexFixture { ASSERT_LESS(i, fooHandles.size()); TermFieldMatchDataPosition pos; pos.setElementWeight(index_weight); - rankProgram->match_data().resolveTermField(fooHandles[i])->reset(docId); - rankProgram->match_data().resolveTermField(fooHandles[i])->appendPosition(pos); + match_data->resolveTermField(fooHandles[i])->reset(docId); + match_data->resolveTermField(fooHandles[i])->appendPosition(pos); } void setBarWeight(uint32_t i, uint32_t docId, int32_t index_weight) { ASSERT_LESS(i, barHandles.size()); TermFieldMatchDataPosition pos; pos.setElementWeight(index_weight); - rankProgram->match_data().resolveTermField(barHandles[i])->reset(docId); - rankProgram->match_data().resolveTermField(barHandles[i])->appendPosition(pos); + match_data->resolveTermField(barHandles[i])->reset(docId); + match_data->resolveTermField(barHandles[i])->appendPosition(pos); } }; diff --git a/searchlib/src/tests/features/raw_score/raw_score_test.cpp b/searchlib/src/tests/features/raw_score/raw_score_test.cpp index 52587c0d8f9..4aad6c6896e 100644 --- a/searchlib/src/tests/features/raw_score/raw_score_test.cpp +++ b/searchlib/src/tests/features/raw_score/raw_score_test.cpp @@ -45,13 +45,14 @@ struct FeatureDumpFixture : public IDumpFeatureVisitor { struct RankFixture : BlueprintFactoryFixture, IndexFixture { QueryEnvironment queryEnv; RankSetup rankSetup; - RankProgram::UP rankProgram; MatchDataLayout mdl; + MatchData::UP match_data; + RankProgram::UP rankProgram; std::vector<TermFieldHandle> fooHandles; std::vector<TermFieldHandle> barHandles; RankFixture(size_t fooCnt, size_t barCnt) : queryEnv(&indexEnv), rankSetup(factory, indexEnv), - rankProgram(), mdl(), fooHandles(), barHandles() + mdl(), match_data(), rankProgram(), fooHandles(), barHandles() { for (size_t i = 0; i < fooCnt; ++i) { uint32_t fieldId = indexEnv.getFieldByName("foo")->id(); @@ -70,14 +71,15 @@ struct RankFixture : BlueprintFactoryFixture, IndexFixture { rankSetup.setFirstPhaseRank(featureName); rankSetup.setIgnoreDefaultRankFeatures(true); ASSERT_TRUE(rankSetup.compile()); + match_data = mdl.createMatchData(); rankProgram = rankSetup.create_first_phase_program(); - rankProgram->setup(mdl, queryEnv); + rankProgram->setup(*match_data, queryEnv); } feature_t getScore(uint32_t docId) { return Utils::getScoreFeature(*rankProgram, docId); } void setScore(TermFieldHandle handle, uint32_t docId, feature_t score) { - rankProgram->match_data().resolveTermField(handle)->setRawScore(docId, score); + match_data->resolveTermField(handle)->setRawScore(docId, score); } void setFooScore(uint32_t i, uint32_t docId, feature_t score) { ASSERT_LESS(i, fooHandles.size()); diff --git a/searchlib/src/tests/features/subqueries/subqueries_test.cpp b/searchlib/src/tests/features/subqueries/subqueries_test.cpp index 37e43b4d2b0..d275cf134c6 100644 --- a/searchlib/src/tests/features/subqueries/subqueries_test.cpp +++ b/searchlib/src/tests/features/subqueries/subqueries_test.cpp @@ -43,22 +43,24 @@ struct FeatureDumpFixture : public IDumpFeatureVisitor { struct RankFixture : BlueprintFactoryFixture, IndexFixture { QueryEnvironment queryEnv; RankSetup rankSetup; - RankProgram::UP rankProgram; MatchDataLayout mdl; + MatchData::UP match_data; + RankProgram::UP rankProgram; std::vector<TermFieldHandle> fooHandles; std::vector<TermFieldHandle> barHandles; RankFixture(size_t fooCnt, size_t barCnt, std::string featureName = "subqueries(foo)") : queryEnv(&indexEnv), rankSetup(factory, indexEnv), - rankProgram(), mdl(), fooHandles(), barHandles() + mdl(), match_data(), rankProgram(), fooHandles(), barHandles() { fooHandles = addFields(fooCnt, indexEnv.getFieldByName("foo")->id()); barHandles = addFields(barCnt, indexEnv.getFieldByName("bar")->id()); rankSetup.setFirstPhaseRank(featureName); rankSetup.setIgnoreDefaultRankFeatures(true); ASSERT_TRUE(rankSetup.compile()); + match_data = mdl.createMatchData(); rankProgram = rankSetup.create_first_phase_program(); - rankProgram->setup(mdl, queryEnv); + rankProgram->setup(*match_data, queryEnv); } std::vector<TermFieldHandle> addFields(size_t count, uint32_t fieldId) { std::vector<TermFieldHandle> handles; @@ -75,7 +77,7 @@ struct RankFixture : BlueprintFactoryFixture, IndexFixture { } void setSubqueries(TermFieldHandle handle, uint32_t docId, uint64_t subqueries) { - rankProgram->match_data().resolveTermField(handle)->setSubqueries(docId, subqueries); + match_data->resolveTermField(handle)->setSubqueries(docId, subqueries); } void setFooSubqueries(uint32_t i, uint32_t docId, uint64_t subqueries) { ASSERT_LESS(i, fooHandles.size()); diff --git a/searchlib/src/tests/fef/featureoverride/featureoverride.cpp b/searchlib/src/tests/fef/featureoverride/featureoverride.cpp index 0ff7e0899e9..e55bd7081a1 100644 --- a/searchlib/src/tests/fef/featureoverride/featureoverride.cpp +++ b/searchlib/src/tests/fef/featureoverride/featureoverride.cpp @@ -141,7 +141,8 @@ TEST("test overrides") overrides.add("value(1,2,3).2", "6.0"); overrides.add("bogus(feature)", "10.0"); - rankProgram->setup(mdl, queryEnv, overrides); + MatchData::UP match_data = mdl.createMatchData(); + rankProgram->setup(*match_data, queryEnv, overrides); std::map<vespalib::string, feature_t> res = Utils::getAllFeatures(*rankProgram, 2); diff --git a/searchlib/src/tests/fef/object_passing/object_passing_test.cpp b/searchlib/src/tests/fef/object_passing/object_passing_test.cpp index 5c0f09a1203..3ae5932889a 100644 --- a/searchlib/src/tests/fef/object_passing/object_passing_test.cpp +++ b/searchlib/src/tests/fef/object_passing/object_passing_test.cpp @@ -7,6 +7,7 @@ #include <vespa/searchlib/fef/test/indexenvironment.h> #include <vespa/searchlib/fef/test/queryenvironment.h> #include <vespa/searchlib/fef/test/plugin/unbox.h> +#include <vespa/searchlib/fef/matchdatalayout.h> #include <vespa/searchlib/fef/rank_program.h> #include <vespa/searchlib/fef/verify_feature.h> #include <vespa/eval/eval/value_type.h> @@ -87,10 +88,11 @@ struct Fixture { return vespalib::eval::error_value; } MatchDataLayout mdl; + MatchData::UP md = mdl.createMatchData(); QueryEnvironment queryEnv(&indexEnv); Properties overrides; RankProgram program(resolver); - program.setup(mdl, queryEnv, overrides); + program.setup(*md, queryEnv, overrides); auto result = program.get_seeds(); EXPECT_EQUAL(1u, result.num_features()); EXPECT_TRUE(!result.is_object(0)); // verifies auto-unboxing diff --git a/searchlib/src/tests/fef/rank_program/rank_program_test.cpp b/searchlib/src/tests/fef/rank_program/rank_program_test.cpp index 8e23731e961..7e28178e5f7 100644 --- a/searchlib/src/tests/fef/rank_program/rank_program_test.cpp +++ b/searchlib/src/tests/fef/rank_program/rank_program_test.cpp @@ -6,6 +6,7 @@ #include <vespa/searchlib/features/rankingexpressionfeature.h> #include <vespa/searchlib/fef/blueprintfactory.h> #include <vespa/searchlib/fef/indexproperties.h> +#include <vespa/searchlib/fef/matchdatalayout.h> #include <vespa/searchlib/fef/test/indexenvironment.h> #include <vespa/searchlib/fef/test/queryenvironment.h> #include <vespa/searchlib/fef/test/plugin/sum.h> @@ -69,10 +70,11 @@ struct Fixture { IndexEnvironment indexEnv; BlueprintResolver::SP resolver; Properties overrides; + MatchData::UP match_data; RankProgram program; size_t track_cnt; Fixture() : factory(), indexEnv(), resolver(new BlueprintResolver(factory, indexEnv)), - overrides(), program(resolver), track_cnt(0) + overrides(), match_data(), program(resolver), track_cnt(0) { factory.addPrototype(Blueprint::SP(new BoxingBlueprint())); factory.addPrototype(Blueprint::SP(new DocidBlueprint())); @@ -107,7 +109,8 @@ struct Fixture { ASSERT_TRUE(resolver->compile()); MatchDataLayout mdl; QueryEnvironment queryEnv(&indexEnv); - program.setup(mdl, queryEnv, overrides); + match_data = mdl.createMatchData(); + program.setup(*match_data, queryEnv, overrides); return *this; } double get(uint32_t docid = default_docid) { diff --git a/searchlib/src/tests/fef/termfieldmodel/termfieldmodel_test.cpp b/searchlib/src/tests/fef/termfieldmodel/termfieldmodel_test.cpp index 57fb19b7b23..01c72497246 100644 --- a/searchlib/src/tests/fef/termfieldmodel/termfieldmodel_test.cpp +++ b/searchlib/src/tests/fef/termfieldmodel/termfieldmodel_test.cpp @@ -207,4 +207,39 @@ TEST("Access subqueries") { EXPECT_EQUAL(0ULL, state.f3->getSubqueries()); } +TEST("require that TermFieldMatchData can be tagged as needed or not") { + TermFieldMatchData tfmd; + tfmd.setFieldId(123); + EXPECT_EQUAL(tfmd.getFieldId(),123u); + EXPECT_TRUE(!tfmd.isNotNeeded()); + tfmd.tagAsNotNeeded(); + EXPECT_EQUAL(tfmd.getFieldId(),123u); + EXPECT_TRUE(tfmd.isNotNeeded()); + tfmd.tagAsNeeded(); + EXPECT_EQUAL(tfmd.getFieldId(),123u); + EXPECT_TRUE(!tfmd.isNotNeeded()); +} + +TEST("require that MatchData soft_reset retains appropriate state") { + auto md = MatchData::makeTestInstance(10, 10); + md->set_termwise_limit(0.5); + auto *old_term = md->resolveTermField(7); + old_term->tagAsNotNeeded(); + old_term->populate_fixed()->setElementWeight(21); + old_term->resetOnlyDocId(42); + EXPECT_EQUAL(md->get_termwise_limit(), 0.5); + EXPECT_TRUE(old_term->isNotNeeded()); + EXPECT_EQUAL(old_term->getFieldId(), 7u); + EXPECT_EQUAL(old_term->getWeight(), 21); + EXPECT_EQUAL(old_term->getDocId(), 42u); + md->soft_reset(); + auto *new_term = md->resolveTermField(7); + EXPECT_EQUAL(new_term, old_term); + EXPECT_EQUAL(md->get_termwise_limit(), 1.0); + EXPECT_TRUE(!new_term->isNotNeeded()); + EXPECT_EQUAL(new_term->getFieldId(), 7u); + EXPECT_EQUAL(new_term->getWeight(), 21); + EXPECT_EQUAL(new_term->getDocId(), TermFieldMatchData::invalidId()); +} + TEST_MAIN() { TEST_RUN_ALL(); } diff --git a/searchlib/src/tests/index/docbuilder/docbuilder_test.cpp b/searchlib/src/tests/index/docbuilder/docbuilder_test.cpp index e483276b050..3e70a8fc40f 100644 --- a/searchlib/src/tests/index/docbuilder/docbuilder_test.cpp +++ b/searchlib/src/tests/index/docbuilder/docbuilder_test.cpp @@ -1,13 +1,4 @@ // Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -/* -*- mode: C++; coding: utf-8; -*- */ - -/* $Id$ - * - * Copyright (C) 2011 Yahoo! Technologies Norway AS - * - * All Rights Reserved - * - */ #include <vespa/log/log.h> LOG_SETUP("docbuilder_test"); diff --git a/searchlib/src/tests/postinglistbm/postinglistbm.cpp b/searchlib/src/tests/postinglistbm/postinglistbm.cpp index 3a20af3e00a..41d94bf7186 100644 --- a/searchlib/src/tests/postinglistbm/postinglistbm.cpp +++ b/searchlib/src/tests/postinglistbm/postinglistbm.cpp @@ -1,6 +1,4 @@ // Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -// Copyright (C) 2002-2003 Fast Search & Transfer ASA -// Copyright (C) 2003 Overture Services Norway AS #include <vespa/searchlib/common/bitvector.h> #include <vespa/searchlib/common/resultset.h> diff --git a/searchlib/src/tests/ranksetup/ranksetup_test.cpp b/searchlib/src/tests/ranksetup/ranksetup_test.cpp index c2ef8f3a46b..7a26180eed2 100644 --- a/searchlib/src/tests/ranksetup/ranksetup_test.cpp +++ b/searchlib/src/tests/ranksetup/ranksetup_test.cpp @@ -87,6 +87,7 @@ private: const RankEnvironment & _rankEnv; MatchDataLayout _layout; std::unique_ptr<RankSetup> _rs; + MatchData::UP _match_data; RankProgram::UP _firstPhaseProgram; RankProgram::UP _secondPhaseProgram; @@ -100,7 +101,7 @@ public: RankExecutor::RankExecutor(const vespalib::string &initRank, const vespalib::string &finalRank, const RankEnvironment &rankEnv) : _initRank(initRank), _finalRank(finalRank), _rankEnv(rankEnv), _layout(), - _rs(), _firstPhaseProgram(), _secondPhaseProgram() + _rs(), _match_data(), _firstPhaseProgram(), _secondPhaseProgram() {} RankExecutor::~RankExecutor() {} @@ -121,12 +122,13 @@ RankExecutor::setup() if (!_rs->compile()) { return false; } + _match_data = _layout.createMatchData(); _firstPhaseProgram = _rs->create_first_phase_program(); - _firstPhaseProgram->setup(_layout, _rankEnv.queryEnvironment()); + _firstPhaseProgram->setup(*_match_data, _rankEnv.queryEnvironment()); if (!_finalRank.empty()) { _secondPhaseProgram = _rs->create_second_phase_program(); - _secondPhaseProgram->setup(_layout, _rankEnv.queryEnvironment()); + _secondPhaseProgram->setup(*_match_data, _rankEnv.queryEnvironment()); } return true; } @@ -154,6 +156,7 @@ private: const RankEnvironment & _rankEnv; RankSetup _setup; MatchDataLayout _layout; + MatchData::UP _match_data; RankProgram::UP _rankProgram; public: @@ -169,6 +172,7 @@ FeatureDumper::FeatureDumper(const RankEnvironment & rankEnv) : _rankEnv(rankEnv), _setup(_rankEnv.factory(), _rankEnv.indexEnvironment()), _layout(), + _match_data(), _rankProgram() {} FeatureDumper::~FeatureDumper() {} @@ -191,8 +195,9 @@ FeatureDumper::setup() return false; } + _match_data = _layout.createMatchData(); _rankProgram = _setup.create_dump_program(); - _rankProgram->setup(_layout, _rankEnv.queryEnvironment()); + _rankProgram->setup(*_match_data, _rankEnv.queryEnvironment()); return true; } @@ -780,12 +785,13 @@ RankSetupTest::testFeatureNormalization() { // RANK context MatchDataLayout layout; QueryEnvironment queryEnv; + MatchData::UP match_data = layout.createMatchData(); RankProgram::UP firstPhaseProgram = rankSetup.create_first_phase_program(); RankProgram::UP secondPhaseProgram = rankSetup.create_second_phase_program(); RankProgram::UP summaryProgram = rankSetup.create_summary_program(); - firstPhaseProgram->setup(layout, queryEnv); - secondPhaseProgram->setup(layout, queryEnv); - summaryProgram->setup(layout, queryEnv); + firstPhaseProgram->setup(*match_data, queryEnv); + secondPhaseProgram->setup(*match_data, queryEnv); + summaryProgram->setup(*match_data, queryEnv); EXPECT_APPROX(2.0, Utils::getScoreFeature(*firstPhaseProgram, 1), 0.001); EXPECT_APPROX(4.0, Utils::getScoreFeature(*secondPhaseProgram, 1), 0.001); @@ -831,8 +837,9 @@ RankSetupTest::testFeatureNormalization() { // DUMP context MatchDataLayout layout; QueryEnvironment queryEnv; + MatchData::UP match_data = layout.createMatchData(); RankProgram::UP rankProgram = rankSetup.create_dump_program(); - rankProgram->setup(layout, queryEnv); + rankProgram->setup(*match_data, queryEnv); { // dump seed features std::map<vespalib::string, feature_t> actual = Utils::getSeedFeatures(*rankProgram, 1); diff --git a/searchlib/src/tests/sortresults/sorttest.cpp b/searchlib/src/tests/sortresults/sorttest.cpp index c4c3fd0596a..6bcdca6b2af 100644 --- a/searchlib/src/tests/sortresults/sorttest.cpp +++ b/searchlib/src/tests/sortresults/sorttest.cpp @@ -1,7 +1,4 @@ // Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -// Copyright (C) 2001-2003 Fast Search & Transfer ASA -// Copyright (C) 2003 Overture Services Norway AS - #include <vespa/searchlib/common/bitvector.h> #include <vespa/searchlib/common/sortresults.h> diff --git a/searchlib/src/tests/stackdumpiterator/stackdumpiteratortest.cpp b/searchlib/src/tests/stackdumpiterator/stackdumpiteratortest.cpp index dbf0534e14a..d3a99dc439a 100644 --- a/searchlib/src/tests/stackdumpiterator/stackdumpiteratortest.cpp +++ b/searchlib/src/tests/stackdumpiterator/stackdumpiteratortest.cpp @@ -1,6 +1,4 @@ // Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -// Copyright (C) 2001-2003 Fast Search & Transfer ASA -// Copyright (C) 2003 Overture Services Norway AS #include "stackdumpiteratortest.h" #include <vespa/searchlib/parsequery/simplequerystack.h> diff --git a/searchlib/src/tests/stackdumpiterator/stackdumpiteratortest.h b/searchlib/src/tests/stackdumpiterator/stackdumpiteratortest.h index 394e1d59ebd..bca1dd45893 100644 --- a/searchlib/src/tests/stackdumpiterator/stackdumpiteratortest.h +++ b/searchlib/src/tests/stackdumpiterator/stackdumpiteratortest.h @@ -1,6 +1,4 @@ // Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -// Copyright (C) 2001-2003 Fast Search & Transfer ASA -// Copyright (C) 2003 Overture Services Norway AS #pragma once diff --git a/searchlib/src/tests/stringenum/stringenum_test.cpp b/searchlib/src/tests/stringenum/stringenum_test.cpp index 41f6e5edbb5..a40c009e543 100644 --- a/searchlib/src/tests/stringenum/stringenum_test.cpp +++ b/searchlib/src/tests/stringenum/stringenum_test.cpp @@ -1,7 +1,4 @@ // Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -// Copyright (C) 2001-2003 Fast Search & Transfer ASA -// Copyright (C) 2003 Overture Services Norway AS - #include <vespa/log/log.h> LOG_SETUP("stringenum"); diff --git a/searchlib/src/tests/url/testurl.cpp b/searchlib/src/tests/url/testurl.cpp index 7ac67480a2e..207f77825c5 100644 --- a/searchlib/src/tests/url/testurl.cpp +++ b/searchlib/src/tests/url/testurl.cpp @@ -1,6 +1,4 @@ // Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -// Copyright (C) 2000-2003 Fast Search & Transfer ASA -// Copyright (C) 2003 Overture Services Norway AS #include <vespa/searchlib/util/url.h> #include <cstdio> diff --git a/searchlib/src/vespa/searchlib/attribute/attributevector.cpp b/searchlib/src/vespa/searchlib/attribute/attributevector.cpp index b21f0e0dfff..8b3af9bddd3 100644 --- a/searchlib/src/vespa/searchlib/attribute/attributevector.cpp +++ b/searchlib/src/vespa/searchlib/attribute/attributevector.cpp @@ -696,6 +696,7 @@ AttributeVector::enableEnumeratedSave(bool enable) { } attribute::IPostingListAttributeBase *AttributeVector::getIPostingListAttributeBase() { return nullptr; } +const attribute::IPostingListAttributeBase *AttributeVector::getIPostingListAttributeBase() const { return nullptr; } const IDocumentWeightAttribute * AttributeVector::asDocumentWeightAttribute() const { return nullptr; } bool AttributeVector::hasPostings() { return getIPostingListAttributeBase() != nullptr; } uint64_t AttributeVector::getUniqueValueCount() const { return getTotalValueCount(); } @@ -804,13 +805,14 @@ uint64_t AttributeVector::getEstimatedSaveByteSize() const { uint64_t headerSize = 4096; - uint64_t totalValueCount = getTotalValueCount(); - uint64_t uniqueValueCount = getUniqueValueCount(); + uint64_t totalValueCount = _status.getNumValues(); + uint64_t uniqueValueCount = _status.getNumUniqueValues(); uint64_t docIdLimit = getCommittedDocIdLimit(); uint64_t datFileSize = 0; uint64_t weightFileSize = 0; uint64_t idxFileSize = 0; uint64_t udatFileSize = 0; + size_t fixedWidth = getFixedWidth(); AddressSpace enumAddressSpace(getEnumStoreAddressSpaceUsage()); if (hasMultiValue()) { @@ -821,8 +823,12 @@ AttributeVector::getEstimatedSaveByteSize() const } if (hasEnum() && getEnumeratedSave()) { datFileSize = headerSize + 4 * totalValueCount; - udatFileSize = headerSize + enumAddressSpace.used() - - 8 * uniqueValueCount; + if (fixedWidth != 0) { + udatFileSize = headerSize + fixedWidth * uniqueValueCount; + } else { + udatFileSize = headerSize + enumAddressSpace.used() + - 8 * uniqueValueCount; + } } else { BasicType::Type basicType(getBasicType()); const Status &status = getStatus(); @@ -844,7 +850,7 @@ AttributeVector::getEstimatedSaveByteSize() const } break; default: - datFileSize = headerSize + getFixedWidth() * totalValueCount; + datFileSize = headerSize + fixedWidth * totalValueCount; break; } } diff --git a/searchlib/src/vespa/searchlib/attribute/attributevector.h b/searchlib/src/vespa/searchlib/attribute/attributevector.h index d9426822603..13ba3f801b7 100644 --- a/searchlib/src/vespa/searchlib/attribute/attributevector.h +++ b/searchlib/src/vespa/searchlib/attribute/attributevector.h @@ -661,6 +661,7 @@ public: bool getEnumeratedSave() const { return _hasEnum && _enableEnumeratedSave; } virtual attribute::IPostingListAttributeBase * getIPostingListAttributeBase(); + virtual const attribute::IPostingListAttributeBase * getIPostingListAttributeBase() const; bool hasPostings(); virtual uint64_t getUniqueValueCount() const; virtual uint64_t getTotalValueCount() const; diff --git a/searchlib/src/vespa/searchlib/attribute/ipostinglistattributebase.h b/searchlib/src/vespa/searchlib/attribute/ipostinglistattributebase.h index 91f2a63976b..8d44c022062 100644 --- a/searchlib/src/vespa/searchlib/attribute/ipostinglistattributebase.h +++ b/searchlib/src/vespa/searchlib/attribute/ipostinglistattributebase.h @@ -22,8 +22,8 @@ public: uint32_t fromLid, uint32_t toLid) = 0; - virtual void - forwardedShrinkLidSpace(uint32_t newSize) = 0; + virtual void forwardedShrinkLidSpace(uint32_t newSize) = 0; + virtual MemoryUsage getMemoryUsage() const = 0; }; diff --git a/searchlib/src/vespa/searchlib/attribute/multinumericpostattribute.h b/searchlib/src/vespa/searchlib/attribute/multinumericpostattribute.h index ac525da419f..68aa8d6673c 100644 --- a/searchlib/src/vespa/searchlib/attribute/multinumericpostattribute.h +++ b/searchlib/src/vespa/searchlib/attribute/multinumericpostattribute.h @@ -104,6 +104,10 @@ public: return this; } + const attribute::IPostingListAttributeBase *getIPostingListAttributeBase() const override { + return this; + } + void fillPostingsFixupEnum(const LoadedEnumAttributeVector &loaded) override { fillPostingsFixupEnumBase(loaded); } diff --git a/searchlib/src/vespa/searchlib/attribute/multistringpostattribute.h b/searchlib/src/vespa/searchlib/attribute/multistringpostattribute.h index 348bef44bf8..04f26d232d5 100644 --- a/searchlib/src/vespa/searchlib/attribute/multistringpostattribute.h +++ b/searchlib/src/vespa/searchlib/attribute/multistringpostattribute.h @@ -105,6 +105,8 @@ public: attribute::IPostingListAttributeBase * getIPostingListAttributeBase() override { return this; } + const attribute::IPostingListAttributeBase * getIPostingListAttributeBase() const override { return this; } + void fillPostingsFixupEnum(const LoadedEnumAttributeVector &loaded) override { fillPostingsFixupEnumBase(loaded); } diff --git a/searchlib/src/vespa/searchlib/attribute/postinglistattribute.cpp b/searchlib/src/vespa/searchlib/attribute/postinglistattribute.cpp index fa24221b888..7750758469b 100644 --- a/searchlib/src/vespa/searchlib/attribute/postinglistattribute.cpp +++ b/searchlib/src/vespa/searchlib/attribute/postinglistattribute.cpp @@ -202,6 +202,12 @@ PostingListAttributeBase<P>::forwardedShrinkLidSpace(uint32_t newSize) (void) _postingList.resizeBitVectors(newSize, newSize); } +template <typename P> +MemoryUsage +PostingListAttributeBase<P>::getMemoryUsage() const +{ + return _postingList.getMemoryUsage(); +} template <typename P, typename LoadedVector, typename LoadedValueType, typename EnumStoreType> diff --git a/searchlib/src/vespa/searchlib/attribute/postinglistattribute.h b/searchlib/src/vespa/searchlib/attribute/postinglistattribute.h index 695c7872255..a8563ef6027 100644 --- a/searchlib/src/vespa/searchlib/attribute/postinglistattribute.h +++ b/searchlib/src/vespa/searchlib/attribute/postinglistattribute.h @@ -65,6 +65,7 @@ protected: uint32_t toLid, EnumStoreComparator &cmp); void forwardedShrinkLidSpace(uint32_t newSize) override; + virtual MemoryUsage getMemoryUsage() const override; public: const PostingList & getPostingList() const { return _postingList; } diff --git a/searchlib/src/vespa/searchlib/attribute/predicate_attribute.h b/searchlib/src/vespa/searchlib/attribute/predicate_attribute.h index 309053e52f1..f318e39f4fa 100644 --- a/searchlib/src/vespa/searchlib/attribute/predicate_attribute.h +++ b/searchlib/src/vespa/searchlib/attribute/predicate_attribute.h @@ -25,7 +25,7 @@ private: /** * Attribute that manages a predicate index. It is not a traditional * attribute in that it doesn't store values for each document, but - * rather keeps an index for boolean search. Summaries are not fetched + * rather keeps an index for predicate search. Summaries are not fetched * from the attribute, but rather using the summary store like a * non-index field. */ diff --git a/searchlib/src/vespa/searchlib/attribute/singlenumericpostattribute.h b/searchlib/src/vespa/searchlib/attribute/singlenumericpostattribute.h index 9235611fd09..b50944492a8 100644 --- a/searchlib/src/vespa/searchlib/attribute/singlenumericpostattribute.h +++ b/searchlib/src/vespa/searchlib/attribute/singlenumericpostattribute.h @@ -95,6 +95,7 @@ public: void fillPostings(LoadedVector & loaded) override { handleFillPostings(loaded); } attribute::IPostingListAttributeBase *getIPostingListAttributeBase() override { return this; } + const attribute::IPostingListAttributeBase *getIPostingListAttributeBase() const override { return this; } void fillPostingsFixupEnum(const LoadedEnumAttributeVector &loaded) override { fillPostingsFixupEnumBase(loaded); } }; diff --git a/searchlib/src/vespa/searchlib/attribute/singlestringpostattribute.h b/searchlib/src/vespa/searchlib/attribute/singlestringpostattribute.h index 506269733ba..de8baf4473f 100644 --- a/searchlib/src/vespa/searchlib/attribute/singlestringpostattribute.h +++ b/searchlib/src/vespa/searchlib/attribute/singlestringpostattribute.h @@ -110,6 +110,10 @@ public: return this; } + const attribute::IPostingListAttributeBase * getIPostingListAttributeBase() const override { + return this; + } + void fillPostingsFixupEnum(const LoadedEnumAttributeVector &loaded) override { fillPostingsFixupEnumBase(loaded); } diff --git a/searchlib/src/vespa/searchlib/bitcompression/countcompression.cpp b/searchlib/src/vespa/searchlib/bitcompression/countcompression.cpp index cec128a3907..fca6c749cfb 100644 --- a/searchlib/src/vespa/searchlib/bitcompression/countcompression.cpp +++ b/searchlib/src/vespa/searchlib/bitcompression/countcompression.cpp @@ -1,6 +1,4 @@ // Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -// Copyright (C) 1998-2003 Fast Search & Transfer ASA -// Copyright (C) 2003 Overture Services Norway AS #include "compression.h" #include "countcompression.h" diff --git a/searchlib/src/vespa/searchlib/bitcompression/posocccompression.cpp b/searchlib/src/vespa/searchlib/bitcompression/posocccompression.cpp index bb8921e8fae..739018b99a5 100644 --- a/searchlib/src/vespa/searchlib/bitcompression/posocccompression.cpp +++ b/searchlib/src/vespa/searchlib/bitcompression/posocccompression.cpp @@ -1,6 +1,4 @@ // Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -// Copyright (C) 2002-2003 Fast Search & Transfer ASA -// Copyright (C) 2003 Overture Services Norway AS #include "compression.h" #include "posocccompression.h" diff --git a/searchlib/src/vespa/searchlib/bitcompression/posocccompression.h b/searchlib/src/vespa/searchlib/bitcompression/posocccompression.h index c0adcc98153..6eb6cac46b6 100644 --- a/searchlib/src/vespa/searchlib/bitcompression/posocccompression.h +++ b/searchlib/src/vespa/searchlib/bitcompression/posocccompression.h @@ -1,6 +1,4 @@ // Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -// Copyright (C) 2002-2003 Fast Search & Transfer ASA -// Copyright (C) 2003 Overture Services Norway AS #pragma once #include <vespa/searchlib/index/docidandfeatures.h> diff --git a/searchlib/src/vespa/searchlib/common/allocatedbitvector.h b/searchlib/src/vespa/searchlib/common/allocatedbitvector.h index 1f895eee93f..6de255c48c9 100644 --- a/searchlib/src/vespa/searchlib/common/allocatedbitvector.h +++ b/searchlib/src/vespa/searchlib/common/allocatedbitvector.h @@ -1,6 +1,4 @@ // Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -// Copyright (C) 1998-2003 Fast Search & Transfer ASA -// Copyright (C) 2003 Overture Services Norway AS #pragma once diff --git a/searchlib/src/vespa/searchlib/common/base.h b/searchlib/src/vespa/searchlib/common/base.h index 0bc2f4401a7..3f462d3e3d1 100644 --- a/searchlib/src/vespa/searchlib/common/base.h +++ b/searchlib/src/vespa/searchlib/common/base.h @@ -1,6 +1,4 @@ // Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -// Copyright (C) 1999-2003 Fast Search & Transfer ASA -// Copyright (C) 2003 Overture Services Norway AS #pragma once diff --git a/searchlib/src/vespa/searchlib/common/documentsummary.cpp b/searchlib/src/vespa/searchlib/common/documentsummary.cpp index 5836c623779..0d00ad1a408 100644 --- a/searchlib/src/vespa/searchlib/common/documentsummary.cpp +++ b/searchlib/src/vespa/searchlib/common/documentsummary.cpp @@ -1,6 +1,4 @@ // Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -// Copyright (C) 1998-2003 Fast Search & Transfer ASA -// Copyright (C) 2003 Overture Services Norway AS #include "documentsummary.h" #include <vespa/fastlib/io/bufferedfile.h> diff --git a/searchlib/src/vespa/searchlib/common/documentsummary.h b/searchlib/src/vespa/searchlib/common/documentsummary.h index 2d88158d5b5..09512d92c1e 100644 --- a/searchlib/src/vespa/searchlib/common/documentsummary.h +++ b/searchlib/src/vespa/searchlib/common/documentsummary.h @@ -1,6 +1,4 @@ // Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -// Copyright (C) 1998-2003 Fast Search & Transfer ASA -// Copyright (C) 2003 Overture Services Norway AS #pragma once diff --git a/searchlib/src/vespa/searchlib/common/gid.h b/searchlib/src/vespa/searchlib/common/gid.h index b4a94c98a9a..33b17fe94e6 100644 --- a/searchlib/src/vespa/searchlib/common/gid.h +++ b/searchlib/src/vespa/searchlib/common/gid.h @@ -1,6 +1,4 @@ // Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -// Copyright (C) 1998-2003 Fast Search & Transfer ASA -// Copyright (C) 2003 Overture Services Norway AS #pragma once diff --git a/searchlib/src/vespa/searchlib/common/growablebitvector.cpp b/searchlib/src/vespa/searchlib/common/growablebitvector.cpp index ede9038fc8d..41c99a41ce9 100644 --- a/searchlib/src/vespa/searchlib/common/growablebitvector.cpp +++ b/searchlib/src/vespa/searchlib/common/growablebitvector.cpp @@ -1,6 +1,4 @@ // Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -// Copyright (C) 1998-2003 Fast Search & Transfer ASA -// Copyright (C) 2003 Overture Services Norway AS #include "growablebitvector.h" diff --git a/searchlib/src/vespa/searchlib/common/growablebitvector.h b/searchlib/src/vespa/searchlib/common/growablebitvector.h index 36c59502804..1c5cd31b235 100644 --- a/searchlib/src/vespa/searchlib/common/growablebitvector.h +++ b/searchlib/src/vespa/searchlib/common/growablebitvector.h @@ -1,6 +1,4 @@ // Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -// Copyright (C) 1998-2003 Fast Search & Transfer ASA -// Copyright (C) 2003 Overture Services Norway AS #pragma once diff --git a/searchlib/src/vespa/searchlib/common/location.cpp b/searchlib/src/vespa/searchlib/common/location.cpp index cda3973b311..6927d9ab6cb 100644 --- a/searchlib/src/vespa/searchlib/common/location.cpp +++ b/searchlib/src/vespa/searchlib/common/location.cpp @@ -1,6 +1,4 @@ // Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -// Copyright (C) 1999-2003 Fast Search & Transfer ASA -// Copyright (C) 2003 Overture Services Norway AS #include "location.h" #include <limits> diff --git a/searchlib/src/vespa/searchlib/common/location.h b/searchlib/src/vespa/searchlib/common/location.h index 4cdb5a81a1a..96821e204e2 100644 --- a/searchlib/src/vespa/searchlib/common/location.h +++ b/searchlib/src/vespa/searchlib/common/location.h @@ -1,5 +1,4 @@ // Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -// Copyright (C) 2004 Overture Services Norway AS #pragma once diff --git a/searchlib/src/vespa/searchlib/common/partialbitvector.h b/searchlib/src/vespa/searchlib/common/partialbitvector.h index 4cfd3e34383..f1d0716ed60 100644 --- a/searchlib/src/vespa/searchlib/common/partialbitvector.h +++ b/searchlib/src/vespa/searchlib/common/partialbitvector.h @@ -1,6 +1,4 @@ // Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -// Copyright (C) 1998-2003 Fast Search & Transfer ASA -// Copyright (C) 2003 Overture Services Norway AS #pragma once diff --git a/searchlib/src/vespa/searchlib/common/rankedhit.h b/searchlib/src/vespa/searchlib/common/rankedhit.h index ed8860e0038..635f6e350a5 100644 --- a/searchlib/src/vespa/searchlib/common/rankedhit.h +++ b/searchlib/src/vespa/searchlib/common/rankedhit.h @@ -1,6 +1,4 @@ // Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -// Copyright (C) 1998-2003 Fast Search & Transfer ASA -// Copyright (C) 2003 Overture Services Norway AS #pragma once diff --git a/searchlib/src/vespa/searchlib/common/reserved.h b/searchlib/src/vespa/searchlib/common/reserved.h index 032bed2fd54..41a540a67c8 100644 --- a/searchlib/src/vespa/searchlib/common/reserved.h +++ b/searchlib/src/vespa/searchlib/common/reserved.h @@ -1,6 +1,4 @@ // Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -// Copyright (C) 2002-2003 Fast Search & Transfer ASA -// Copyright (C) 2003 Overture Services Norway AS #pragma once diff --git a/searchlib/src/vespa/searchlib/common/resultset.cpp b/searchlib/src/vespa/searchlib/common/resultset.cpp index 44e70886956..20c636df77c 100644 --- a/searchlib/src/vespa/searchlib/common/resultset.cpp +++ b/searchlib/src/vespa/searchlib/common/resultset.cpp @@ -1,6 +1,4 @@ // Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -// Copyright (C) 1998-2003 Fast Search & Transfer ASA -// Copyright (C) 2003 Overture Services Norway AS #include "resultset.h" #include "bitvector.h" diff --git a/searchlib/src/vespa/searchlib/common/sortresults.cpp b/searchlib/src/vespa/searchlib/common/sortresults.cpp index 11f6eb306eb..ed86014f7b3 100644 --- a/searchlib/src/vespa/searchlib/common/sortresults.cpp +++ b/searchlib/src/vespa/searchlib/common/sortresults.cpp @@ -1,6 +1,4 @@ // Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -// Copyright (C) 2001-2003 Fast Search & Transfer ASA -// Copyright (C) 2003 Overture Services Norway AS #include "sortresults.h" #include <vespa/searchlib/util/sort.h> diff --git a/searchlib/src/vespa/searchlib/common/sortresults.h b/searchlib/src/vespa/searchlib/common/sortresults.h index 8da7073b4f2..26bdc8eba96 100644 --- a/searchlib/src/vespa/searchlib/common/sortresults.h +++ b/searchlib/src/vespa/searchlib/common/sortresults.h @@ -1,6 +1,4 @@ // Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -// Copyright (C) 2001-2003 Fast Search & Transfer ASA -// Copyright (C) 2003 Overture Services Norway AS #pragma once diff --git a/searchlib/src/vespa/searchlib/config/CMakeLists.txt b/searchlib/src/vespa/searchlib/config/CMakeLists.txt index da78c4c74ad..2f34d228f60 100644 --- a/searchlib/src/vespa/searchlib/config/CMakeLists.txt +++ b/searchlib/src/vespa/searchlib/config/CMakeLists.txt @@ -4,4 +4,4 @@ vespa_add_library(searchlib_sconfig OBJECT DEPENDS ) vespa_generate_config(searchlib_sconfig translogserver.def) -install(FILES translogserver.def DESTINATION var/db/vespa/config_server/serverdb/classes) +install(FILES translogserver.def RENAME searchlib.translogserver.def DESTINATION var/db/vespa/config_server/serverdb/classes) diff --git a/searchlib/src/vespa/searchlib/diskindex/bitvectorfile.cpp b/searchlib/src/vespa/searchlib/diskindex/bitvectorfile.cpp index 1a9107db4bb..defacdb05d7 100644 --- a/searchlib/src/vespa/searchlib/diskindex/bitvectorfile.cpp +++ b/searchlib/src/vespa/searchlib/diskindex/bitvectorfile.cpp @@ -1,6 +1,4 @@ // Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -// Copyright (C) 1998-2003 Fast Search & Transfer ASA -// Copyright (C) 2003 Overture Services Norway AS #include "bitvectorfile.h" #include <vespa/searchlib/index/bitvectorkeys.h> diff --git a/searchlib/src/vespa/searchlib/diskindex/bitvectorfile.h b/searchlib/src/vespa/searchlib/diskindex/bitvectorfile.h index f3b34285085..1b7b522bc52 100644 --- a/searchlib/src/vespa/searchlib/diskindex/bitvectorfile.h +++ b/searchlib/src/vespa/searchlib/diskindex/bitvectorfile.h @@ -1,6 +1,5 @@ // Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -// Copyright (C) 1998-2003 Fast Search & Transfer ASA -// Copyright (C) 2003 Overture Services Norway AS + #pragma once #include <vespa/fastlib/io/bufferedfile.h> diff --git a/searchlib/src/vespa/searchlib/diskindex/bitvectoridxfile.cpp b/searchlib/src/vespa/searchlib/diskindex/bitvectoridxfile.cpp index 51caad0f481..856c527a8b5 100644 --- a/searchlib/src/vespa/searchlib/diskindex/bitvectoridxfile.cpp +++ b/searchlib/src/vespa/searchlib/diskindex/bitvectoridxfile.cpp @@ -1,6 +1,4 @@ // Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -// Copyright (C) 1998-2003 Fast Search & Transfer ASA -// Copyright (C) 2003 Overture Services Norway AS #include "bitvectoridxfile.h" #include <vespa/searchlib/index/bitvectorkeys.h> diff --git a/searchlib/src/vespa/searchlib/diskindex/bitvectoridxfile.h b/searchlib/src/vespa/searchlib/diskindex/bitvectoridxfile.h index 0e19af34f00..0ab40d9c4a3 100644 --- a/searchlib/src/vespa/searchlib/diskindex/bitvectoridxfile.h +++ b/searchlib/src/vespa/searchlib/diskindex/bitvectoridxfile.h @@ -1,6 +1,5 @@ // Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -// Copyright (C) 1998-2003 Fast Search & Transfer ASA -// Copyright (C) 2003 Overture Services Norway AS + #pragma once #include <vespa/fastlib/io/bufferedfile.h> diff --git a/searchlib/src/vespa/searchlib/diskindex/extposocc.cpp b/searchlib/src/vespa/searchlib/diskindex/extposocc.cpp index aaacf0b6b67..89c801f04b5 100644 --- a/searchlib/src/vespa/searchlib/diskindex/extposocc.cpp +++ b/searchlib/src/vespa/searchlib/diskindex/extposocc.cpp @@ -1,7 +1,4 @@ // Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -// Copyright (C) 2002-2003 Fast Search & Transfer ASA -// Copyright (C) 2003 Overture Services Norway AS - #include "extposocc.h" #include "zcposocc.h" diff --git a/searchlib/src/vespa/searchlib/diskindex/extposocc.h b/searchlib/src/vespa/searchlib/diskindex/extposocc.h index 1c89323dd25..12c57402def 100644 --- a/searchlib/src/vespa/searchlib/diskindex/extposocc.h +++ b/searchlib/src/vespa/searchlib/diskindex/extposocc.h @@ -1,6 +1,4 @@ // Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -// Copyright (C) 2002-2003 Fast Search & Transfer ASA -// Copyright (C) 2003 Overture Services Norway AS #pragma once diff --git a/searchlib/src/vespa/searchlib/diskindex/fusion.cpp b/searchlib/src/vespa/searchlib/diskindex/fusion.cpp index 7d4efe2d69d..97d21caef96 100644 --- a/searchlib/src/vespa/searchlib/diskindex/fusion.cpp +++ b/searchlib/src/vespa/searchlib/diskindex/fusion.cpp @@ -1,5 +1,4 @@ // Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -// Copyright (C) 2003 Fast Search & Transfer ASA #include "fusion.h" #include "fieldreader.h" diff --git a/searchlib/src/vespa/searchlib/diskindex/fusion.h b/searchlib/src/vespa/searchlib/diskindex/fusion.h index a99b7936d87..76547ad0e5f 100644 --- a/searchlib/src/vespa/searchlib/diskindex/fusion.h +++ b/searchlib/src/vespa/searchlib/diskindex/fusion.h @@ -1,6 +1,4 @@ // Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -// Copyright (C) 2001-2003 Fast Search & Transfer ASA -// Copyright (C) 2003 Overture Services Norway AS #pragma once diff --git a/searchlib/src/vespa/searchlib/engine/errorcodes.h b/searchlib/src/vespa/searchlib/engine/errorcodes.h index 36ab38a4555..3b2357a1ebb 100644 --- a/searchlib/src/vespa/searchlib/engine/errorcodes.h +++ b/searchlib/src/vespa/searchlib/engine/errorcodes.h @@ -1,6 +1,4 @@ // Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -// Copyright (C) 1999-2003 Fast Search & Transfer ASA -// Copyright (C) 2003 Overture Services Norway AS #pragma once diff --git a/searchlib/src/vespa/searchlib/features/attributematchfeature.cpp b/searchlib/src/vespa/searchlib/features/attributematchfeature.cpp index bf3297f3e14..2ff53951d8b 100644 --- a/searchlib/src/vespa/searchlib/features/attributematchfeature.cpp +++ b/searchlib/src/vespa/searchlib/features/attributematchfeature.cpp @@ -253,7 +253,7 @@ AttributeMatchExecutor<T>::execute(uint32_t docId) template <typename T> void -AttributeMatchExecutor<T>::handle_bind_match_data(MatchData &md) +AttributeMatchExecutor<T>::handle_bind_match_data(const MatchData &md) { _cmp.bind_match_data(md); } diff --git a/searchlib/src/vespa/searchlib/features/attributematchfeature.h b/searchlib/src/vespa/searchlib/features/attributematchfeature.h index 8396493b81d..707572abf9e 100644 --- a/searchlib/src/vespa/searchlib/features/attributematchfeature.h +++ b/searchlib/src/vespa/searchlib/features/attributematchfeature.h @@ -69,12 +69,12 @@ private: feature_t getWeight() const; feature_t getSignificance() const; feature_t getImportance() const { return (getWeight() + getSignificance()) * 0.5; } - void bind_match_data(fef::MatchData &md) { _md = &md; } + void bind_match_data(const fef::MatchData &md) { _md = &md; } }; Computer _cmp; - virtual void handle_bind_match_data(fef::MatchData &md) override; + virtual void handle_bind_match_data(const fef::MatchData &md) override; public: /** diff --git a/searchlib/src/vespa/searchlib/features/element_completeness_feature.cpp b/searchlib/src/vespa/searchlib/features/element_completeness_feature.cpp index c3bb87379ad..18988281cbd 100644 --- a/searchlib/src/vespa/searchlib/features/element_completeness_feature.cpp +++ b/searchlib/src/vespa/searchlib/features/element_completeness_feature.cpp @@ -73,7 +73,7 @@ ElementCompletenessExecutor::execute(uint32_t docId) } void -ElementCompletenessExecutor::handle_bind_match_data(fef::MatchData &md) +ElementCompletenessExecutor::handle_bind_match_data(const fef::MatchData &md) { _md = &md; } diff --git a/searchlib/src/vespa/searchlib/features/element_completeness_feature.h b/searchlib/src/vespa/searchlib/features/element_completeness_feature.h index 013efaedc22..1b835da45d2 100644 --- a/searchlib/src/vespa/searchlib/features/element_completeness_feature.h +++ b/searchlib/src/vespa/searchlib/features/element_completeness_feature.h @@ -82,7 +82,7 @@ private: static bool nextElement(Item &item); - void handle_bind_match_data(fef::MatchData &md) override; + void handle_bind_match_data(const fef::MatchData &md) override; public: ElementCompletenessExecutor(const fef::IQueryEnvironment &env, diff --git a/searchlib/src/vespa/searchlib/features/element_similarity_feature.cpp b/searchlib/src/vespa/searchlib/features/element_similarity_feature.cpp index e3c0217be15..c9eab238f82 100644 --- a/searchlib/src/vespa/searchlib/features/element_similarity_feature.cpp +++ b/searchlib/src/vespa/searchlib/features/element_similarity_feature.cpp @@ -230,7 +230,7 @@ public: bool isPure() override { return _terms.handles.empty(); } - void handle_bind_match_data(fef::MatchData &md) override { + void handle_bind_match_data(const fef::MatchData &md) override { _md = &md; } diff --git a/searchlib/src/vespa/searchlib/features/fieldinfofeature.cpp b/searchlib/src/vespa/searchlib/features/fieldinfofeature.cpp index 85f3fc9b652..960dcc7dfd1 100644 --- a/searchlib/src/vespa/searchlib/features/fieldinfofeature.cpp +++ b/searchlib/src/vespa/searchlib/features/fieldinfofeature.cpp @@ -59,7 +59,7 @@ IndexFieldInfoExecutor::execute(uint32_t docId) } void -IndexFieldInfoExecutor::handle_bind_match_data(fef::MatchData &md) +IndexFieldInfoExecutor::handle_bind_match_data(const fef::MatchData &md) { _md = &md; } @@ -98,7 +98,7 @@ AttrFieldInfoExecutor::execute(uint32_t docId) } void -AttrFieldInfoExecutor::handle_bind_match_data(fef::MatchData &md) +AttrFieldInfoExecutor::handle_bind_match_data(const fef::MatchData &md) { _md = &md; } diff --git a/searchlib/src/vespa/searchlib/features/fieldinfofeature.h b/searchlib/src/vespa/searchlib/features/fieldinfofeature.h index 08cf99ed32a..7ced5d5cb9f 100644 --- a/searchlib/src/vespa/searchlib/features/fieldinfofeature.h +++ b/searchlib/src/vespa/searchlib/features/fieldinfofeature.h @@ -18,7 +18,7 @@ private: uint32_t _fieldHandle; const fef::MatchData *_md; - void handle_bind_match_data(fef::MatchData &md) override; + void handle_bind_match_data(const fef::MatchData &md) override; public: IndexFieldInfoExecutor(feature_t type, feature_t isFilter, @@ -35,7 +35,7 @@ private: uint32_t _fieldHandle; const fef::MatchData *_md; - void handle_bind_match_data(fef::MatchData &md) override; + void handle_bind_match_data(const fef::MatchData &md) override; public: AttrFieldInfoExecutor(feature_t type, uint32_t fieldHandle); diff --git a/searchlib/src/vespa/searchlib/features/fieldlengthfeature.cpp b/searchlib/src/vespa/searchlib/features/fieldlengthfeature.cpp index 0ec1f8bd038..d0680e8fc19 100644 --- a/searchlib/src/vespa/searchlib/features/fieldlengthfeature.cpp +++ b/searchlib/src/vespa/searchlib/features/fieldlengthfeature.cpp @@ -56,7 +56,7 @@ FieldLengthExecutor::execute(uint32_t docId) } void -FieldLengthExecutor::handle_bind_match_data(MatchData &md) +FieldLengthExecutor::handle_bind_match_data(const MatchData &md) { _md = &md; } diff --git a/searchlib/src/vespa/searchlib/features/fieldlengthfeature.h b/searchlib/src/vespa/searchlib/features/fieldlengthfeature.h index a818a65d26e..4988bb97546 100644 --- a/searchlib/src/vespa/searchlib/features/fieldlengthfeature.h +++ b/searchlib/src/vespa/searchlib/features/fieldlengthfeature.h @@ -15,7 +15,7 @@ private: std::vector<fef::TermFieldHandle> _fieldHandles; const fef::MatchData *_md; - virtual void handle_bind_match_data(fef::MatchData &md) override; + virtual void handle_bind_match_data(const fef::MatchData &md) override; public: /** diff --git a/searchlib/src/vespa/searchlib/features/fieldmatchfeature.cpp b/searchlib/src/vespa/searchlib/features/fieldmatchfeature.cpp index bea6e032e81..f5f8652461e 100644 --- a/searchlib/src/vespa/searchlib/features/fieldmatchfeature.cpp +++ b/searchlib/src/vespa/searchlib/features/fieldmatchfeature.cpp @@ -86,7 +86,7 @@ FieldMatchExecutor::execute(uint32_t docId) } void -FieldMatchExecutor::handle_bind_match_data(fef::MatchData &md) +FieldMatchExecutor::handle_bind_match_data(const fef::MatchData &md) { _splitter.bind_match_data(md); } diff --git a/searchlib/src/vespa/searchlib/features/fieldmatchfeature.h b/searchlib/src/vespa/searchlib/features/fieldmatchfeature.h index 287af60b021..71ac1023df6 100644 --- a/searchlib/src/vespa/searchlib/features/fieldmatchfeature.h +++ b/searchlib/src/vespa/searchlib/features/fieldmatchfeature.h @@ -19,7 +19,7 @@ private: const fieldmatch::Params & _params; fieldmatch::Computer _cmp; - void handle_bind_match_data(fef::MatchData &md) override; + void handle_bind_match_data(const fef::MatchData &md) override; public: /** diff --git a/searchlib/src/vespa/searchlib/features/fieldtermmatchfeature.cpp b/searchlib/src/vespa/searchlib/features/fieldtermmatchfeature.cpp index 0f71d5dcbec..a7a00bee956 100644 --- a/searchlib/src/vespa/searchlib/features/fieldtermmatchfeature.cpp +++ b/searchlib/src/vespa/searchlib/features/fieldtermmatchfeature.cpp @@ -63,7 +63,7 @@ FieldTermMatchExecutor::execute(uint32_t docId) } void -FieldTermMatchExecutor::handle_bind_match_data(fef::MatchData &md) +FieldTermMatchExecutor::handle_bind_match_data(const fef::MatchData &md) { _md = &md; } diff --git a/searchlib/src/vespa/searchlib/features/fieldtermmatchfeature.h b/searchlib/src/vespa/searchlib/features/fieldtermmatchfeature.h index 02dfa17ba33..0f89f7eeb75 100644 --- a/searchlib/src/vespa/searchlib/features/fieldtermmatchfeature.h +++ b/searchlib/src/vespa/searchlib/features/fieldtermmatchfeature.h @@ -27,7 +27,7 @@ private: fef::TermFieldHandle _fieldHandle; const fef::MatchData *_md; - void handle_bind_match_data(fef::MatchData &md) override; + void handle_bind_match_data(const fef::MatchData &md) override; }; /** diff --git a/searchlib/src/vespa/searchlib/features/flow_completeness_feature.cpp b/searchlib/src/vespa/searchlib/features/flow_completeness_feature.cpp index 5c93566698e..c46d602983d 100644 --- a/searchlib/src/vespa/searchlib/features/flow_completeness_feature.cpp +++ b/searchlib/src/vespa/searchlib/features/flow_completeness_feature.cpp @@ -234,7 +234,7 @@ FlowCompletenessExecutor::execute(uint32_t) } void -FlowCompletenessExecutor::handle_bind_match_data(fef::MatchData &md) +FlowCompletenessExecutor::handle_bind_match_data(const fef::MatchData &md) { _md = &md; } diff --git a/searchlib/src/vespa/searchlib/features/flow_completeness_feature.h b/searchlib/src/vespa/searchlib/features/flow_completeness_feature.h index cdfa0356307..db5c53beac8 100644 --- a/searchlib/src/vespa/searchlib/features/flow_completeness_feature.h +++ b/searchlib/src/vespa/searchlib/features/flow_completeness_feature.h @@ -62,7 +62,7 @@ private: static bool nextElement(Item &item); - void handle_bind_match_data(fef::MatchData &md) override; + void handle_bind_match_data(const fef::MatchData &md) override; public: FlowCompletenessExecutor(const fef::IQueryEnvironment &env, diff --git a/searchlib/src/vespa/searchlib/features/item_raw_score_feature.cpp b/searchlib/src/vespa/searchlib/features/item_raw_score_feature.cpp index a7476185000..45baf646656 100644 --- a/searchlib/src/vespa/searchlib/features/item_raw_score_feature.cpp +++ b/searchlib/src/vespa/searchlib/features/item_raw_score_feature.cpp @@ -23,7 +23,7 @@ ItemRawScoreExecutor::execute(uint32_t docId) } void -ItemRawScoreExecutor::handle_bind_match_data(MatchData &md) +ItemRawScoreExecutor::handle_bind_match_data(const MatchData &md) { _md = &md; } @@ -42,7 +42,7 @@ SimpleItemRawScoreExecutor::execute(uint32_t docId) } void -SimpleItemRawScoreExecutor::handle_bind_match_data(MatchData &md) +SimpleItemRawScoreExecutor::handle_bind_match_data(const MatchData &md) { _md = &md; } diff --git a/searchlib/src/vespa/searchlib/features/item_raw_score_feature.h b/searchlib/src/vespa/searchlib/features/item_raw_score_feature.h index 3aa1672b05d..d6a55f29632 100644 --- a/searchlib/src/vespa/searchlib/features/item_raw_score_feature.h +++ b/searchlib/src/vespa/searchlib/features/item_raw_score_feature.h @@ -16,7 +16,7 @@ private: HandleVector _handles; const fef::MatchData *_md; - void handle_bind_match_data(fef::MatchData &md) override; + void handle_bind_match_data(const fef::MatchData &md) override; public: ItemRawScoreExecutor(HandleVector handles) @@ -30,7 +30,7 @@ private: fef::TermFieldHandle _handle; const fef::MatchData *_md; - void handle_bind_match_data(fef::MatchData &md) override; + void handle_bind_match_data(const fef::MatchData &md) override; public: SimpleItemRawScoreExecutor(fef::TermFieldHandle handle) diff --git a/searchlib/src/vespa/searchlib/features/jarowinklerdistancefeature.cpp b/searchlib/src/vespa/searchlib/features/jarowinklerdistancefeature.cpp index 3f4817d61d2..a5e3e2da5ba 100644 --- a/searchlib/src/vespa/searchlib/features/jarowinklerdistancefeature.cpp +++ b/searchlib/src/vespa/searchlib/features/jarowinklerdistancefeature.cpp @@ -59,7 +59,7 @@ JaroWinklerDistanceExecutor::execute(uint32_t docId) } void -JaroWinklerDistanceExecutor::handle_bind_match_data(fef::MatchData &md) +JaroWinklerDistanceExecutor::handle_bind_match_data(const fef::MatchData &md) { _md = &md; } diff --git a/searchlib/src/vespa/searchlib/features/jarowinklerdistancefeature.h b/searchlib/src/vespa/searchlib/features/jarowinklerdistancefeature.h index 0497d2a2f73..a8d6eacf0eb 100644 --- a/searchlib/src/vespa/searchlib/features/jarowinklerdistancefeature.h +++ b/searchlib/src/vespa/searchlib/features/jarowinklerdistancefeature.h @@ -43,7 +43,7 @@ private: std::vector<fef::TermFieldHandle> _termFieldHandles; // The handles of all query terms. const fef::MatchData *_md; - void handle_bind_match_data(fef::MatchData &md) override; + void handle_bind_match_data(const fef::MatchData &md) override; }; /** diff --git a/searchlib/src/vespa/searchlib/features/matchcountfeature.cpp b/searchlib/src/vespa/searchlib/features/matchcountfeature.cpp index 51a7a952781..fd453e17eb1 100644 --- a/searchlib/src/vespa/searchlib/features/matchcountfeature.cpp +++ b/searchlib/src/vespa/searchlib/features/matchcountfeature.cpp @@ -36,7 +36,7 @@ MatchCountExecutor::execute(uint32_t docId) } void -MatchCountExecutor::handle_bind_match_data(MatchData &md) +MatchCountExecutor::handle_bind_match_data(const MatchData &md) { _md = &md; } diff --git a/searchlib/src/vespa/searchlib/features/matchcountfeature.h b/searchlib/src/vespa/searchlib/features/matchcountfeature.h index c4123016e16..eadb5064c57 100644 --- a/searchlib/src/vespa/searchlib/features/matchcountfeature.h +++ b/searchlib/src/vespa/searchlib/features/matchcountfeature.h @@ -18,7 +18,7 @@ private: std::vector<fef::TermFieldHandle> _handles; const fef::MatchData *_md; - virtual void handle_bind_match_data(fef::MatchData &md) override; + virtual void handle_bind_match_data(const fef::MatchData &md) override; public: MatchCountExecutor(uint32_t fieldId, const fef::IQueryEnvironment &env); diff --git a/searchlib/src/vespa/searchlib/features/matchesfeature.cpp b/searchlib/src/vespa/searchlib/features/matchesfeature.cpp index c2e36551648..f4788ee74c8 100644 --- a/searchlib/src/vespa/searchlib/features/matchesfeature.cpp +++ b/searchlib/src/vespa/searchlib/features/matchesfeature.cpp @@ -40,7 +40,7 @@ MatchesExecutor::execute(uint32_t docId) } void -MatchesExecutor::handle_bind_match_data(MatchData &md) +MatchesExecutor::handle_bind_match_data(const MatchData &md) { _md = &md; } diff --git a/searchlib/src/vespa/searchlib/features/matchesfeature.h b/searchlib/src/vespa/searchlib/features/matchesfeature.h index fe82929d2a7..c6366349dd9 100644 --- a/searchlib/src/vespa/searchlib/features/matchesfeature.h +++ b/searchlib/src/vespa/searchlib/features/matchesfeature.h @@ -18,7 +18,7 @@ private: std::vector<fef::TermFieldHandle> _handles; const fef::MatchData *_md; - void handle_bind_match_data(fef::MatchData &md) override; + void handle_bind_match_data(const fef::MatchData &md) override; public: MatchesExecutor(uint32_t fieldId, diff --git a/searchlib/src/vespa/searchlib/features/native_dot_product_feature.cpp b/searchlib/src/vespa/searchlib/features/native_dot_product_feature.cpp index 6986703eaf6..cb8136e8b7f 100644 --- a/searchlib/src/vespa/searchlib/features/native_dot_product_feature.cpp +++ b/searchlib/src/vespa/searchlib/features/native_dot_product_feature.cpp @@ -35,7 +35,7 @@ NativeDotProductExecutor::execute(uint32_t docId) } void -NativeDotProductExecutor::handle_bind_match_data(fef::MatchData &md) +NativeDotProductExecutor::handle_bind_match_data(const fef::MatchData &md) { _md = &md; } diff --git a/searchlib/src/vespa/searchlib/features/native_dot_product_feature.h b/searchlib/src/vespa/searchlib/features/native_dot_product_feature.h index cc29ecd5e6b..a71d23f3158 100644 --- a/searchlib/src/vespa/searchlib/features/native_dot_product_feature.h +++ b/searchlib/src/vespa/searchlib/features/native_dot_product_feature.h @@ -17,7 +17,7 @@ private: std::vector<Pair> _pairs; const fef::MatchData *_md; - void handle_bind_match_data(fef::MatchData &md) override; + void handle_bind_match_data(const fef::MatchData &md) override; public: NativeDotProductExecutor(const fef::IQueryEnvironment &env, uint32_t fieldId); diff --git a/searchlib/src/vespa/searchlib/features/nativeattributematchfeature.cpp b/searchlib/src/vespa/searchlib/features/nativeattributematchfeature.cpp index 4243bb83e03..1e6423f9de8 100644 --- a/searchlib/src/vespa/searchlib/features/nativeattributematchfeature.cpp +++ b/searchlib/src/vespa/searchlib/features/nativeattributematchfeature.cpp @@ -73,7 +73,7 @@ NativeAttributeMatchExecutorMulti::execute(uint32_t docId) } void -NativeAttributeMatchExecutorMulti::handle_bind_match_data(MatchData &md) +NativeAttributeMatchExecutorMulti::handle_bind_match_data(const MatchData &md) { _md = &md; } @@ -88,7 +88,7 @@ NativeAttributeMatchExecutorSingle::execute(uint32_t docId) } void -NativeAttributeMatchExecutorSingle::handle_bind_match_data(MatchData &md) +NativeAttributeMatchExecutorSingle::handle_bind_match_data(const MatchData &md) { _md = &md; } diff --git a/searchlib/src/vespa/searchlib/features/nativeattributematchfeature.h b/searchlib/src/vespa/searchlib/features/nativeattributematchfeature.h index 4ebdc871bb5..e47cbed0344 100644 --- a/searchlib/src/vespa/searchlib/features/nativeattributematchfeature.h +++ b/searchlib/src/vespa/searchlib/features/nativeattributematchfeature.h @@ -57,7 +57,7 @@ private: std::vector<CachedTermData> _queryTermData; const fef::MatchData *_md; - void handle_bind_match_data(fef::MatchData &md) override; + void handle_bind_match_data(const fef::MatchData &md) override; public: NativeAttributeMatchExecutorMulti(const Precomputed & setup) : _divisor(setup.second), _queryTermData(setup.first), _md(nullptr) { } void execute(uint32_t docId) override; @@ -69,7 +69,7 @@ private: CachedTermData _queryTermData; const fef::MatchData *_md; - void handle_bind_match_data(fef::MatchData &md) override; + void handle_bind_match_data(const fef::MatchData &md) override; public: NativeAttributeMatchExecutorSingle(const Precomputed & setup) : diff --git a/searchlib/src/vespa/searchlib/features/nativefieldmatchfeature.cpp b/searchlib/src/vespa/searchlib/features/nativefieldmatchfeature.cpp index e4b633d54dd..84ad17e1cb0 100644 --- a/searchlib/src/vespa/searchlib/features/nativefieldmatchfeature.cpp +++ b/searchlib/src/vespa/searchlib/features/nativefieldmatchfeature.cpp @@ -83,7 +83,7 @@ NativeFieldMatchExecutor::execute(uint32_t docId) } void -NativeFieldMatchExecutor::handle_bind_match_data(fef::MatchData &md) +NativeFieldMatchExecutor::handle_bind_match_data(const fef::MatchData &md) { _md = &md; } diff --git a/searchlib/src/vespa/searchlib/features/nativefieldmatchfeature.h b/searchlib/src/vespa/searchlib/features/nativefieldmatchfeature.h index d47dece1654..cb676e5b775 100644 --- a/searchlib/src/vespa/searchlib/features/nativefieldmatchfeature.h +++ b/searchlib/src/vespa/searchlib/features/nativefieldmatchfeature.h @@ -73,7 +73,7 @@ private: return table->get(index); } - virtual void handle_bind_match_data(fef::MatchData &md) override; + virtual void handle_bind_match_data(const fef::MatchData &md) override; public: NativeFieldMatchExecutor(const fef::IQueryEnvironment & env, diff --git a/searchlib/src/vespa/searchlib/features/nativeproximityfeature.cpp b/searchlib/src/vespa/searchlib/features/nativeproximityfeature.cpp index 3c92db6b937..a31d9207e05 100644 --- a/searchlib/src/vespa/searchlib/features/nativeproximityfeature.cpp +++ b/searchlib/src/vespa/searchlib/features/nativeproximityfeature.cpp @@ -97,7 +97,7 @@ NativeProximityExecutor::execute(uint32_t docId) } void -NativeProximityExecutor::handle_bind_match_data(fef::MatchData &md) +NativeProximityExecutor::handle_bind_match_data(const fef::MatchData &md) { _md = &md; } diff --git a/searchlib/src/vespa/searchlib/features/nativeproximityfeature.h b/searchlib/src/vespa/searchlib/features/nativeproximityfeature.h index cda6776d42e..f98fe2bfd22 100644 --- a/searchlib/src/vespa/searchlib/features/nativeproximityfeature.h +++ b/searchlib/src/vespa/searchlib/features/nativeproximityfeature.h @@ -62,7 +62,7 @@ private: feature_t calculateScoreForField(const FieldSetup & fs, uint32_t docId); feature_t calculateScoreForPair(const TermPair & pair, uint32_t fieldId, uint32_t docId); - virtual void handle_bind_match_data(fef::MatchData &md) override; + virtual void handle_bind_match_data(const fef::MatchData &md) override; public: NativeProximityExecutor(const fef::IQueryEnvironment & env, const NativeProximityParams & params); diff --git a/searchlib/src/vespa/searchlib/features/proximityfeature.cpp b/searchlib/src/vespa/searchlib/features/proximityfeature.cpp index e6303ace100..f625e30f378 100644 --- a/searchlib/src/vespa/searchlib/features/proximityfeature.cpp +++ b/searchlib/src/vespa/searchlib/features/proximityfeature.cpp @@ -51,7 +51,7 @@ ProximityExecutor::execute(uint32_t docId) } void -ProximityExecutor::handle_bind_match_data(fef::MatchData &md) +ProximityExecutor::handle_bind_match_data(const fef::MatchData &md) { _md = &md; } diff --git a/searchlib/src/vespa/searchlib/features/proximityfeature.h b/searchlib/src/vespa/searchlib/features/proximityfeature.h index 5a46bafe869..14a80628004 100644 --- a/searchlib/src/vespa/searchlib/features/proximityfeature.h +++ b/searchlib/src/vespa/searchlib/features/proximityfeature.h @@ -41,7 +41,7 @@ private: bool findBest(const fef::TermFieldMatchData &matchA, const fef::TermFieldMatchData &matchB); - void handle_bind_match_data(fef::MatchData &md) override; + void handle_bind_match_data(const fef::MatchData &md) override; }; /** diff --git a/searchlib/src/vespa/searchlib/features/querycompletenessfeature.cpp b/searchlib/src/vespa/searchlib/features/querycompletenessfeature.cpp index af44f75e33f..b4b6a1b0eb4 100644 --- a/searchlib/src/vespa/searchlib/features/querycompletenessfeature.cpp +++ b/searchlib/src/vespa/searchlib/features/querycompletenessfeature.cpp @@ -62,7 +62,7 @@ QueryCompletenessExecutor::execute(uint32_t docId) } void -QueryCompletenessExecutor::handle_bind_match_data(fef::MatchData &md) +QueryCompletenessExecutor::handle_bind_match_data(const fef::MatchData &md) { _md = &md; } diff --git a/searchlib/src/vespa/searchlib/features/querycompletenessfeature.h b/searchlib/src/vespa/searchlib/features/querycompletenessfeature.h index 5e30563f6ec..a5e6bbdc2bb 100644 --- a/searchlib/src/vespa/searchlib/features/querycompletenessfeature.h +++ b/searchlib/src/vespa/searchlib/features/querycompletenessfeature.h @@ -38,7 +38,7 @@ private: std::vector<fef::TermFieldHandle> _fieldHandles; const fef::MatchData *_md; - void handle_bind_match_data(fef::MatchData &md) override; + void handle_bind_match_data(const fef::MatchData &md) override; }; /** diff --git a/searchlib/src/vespa/searchlib/features/raw_score_feature.cpp b/searchlib/src/vespa/searchlib/features/raw_score_feature.cpp index 2fa59111d00..02e44e781d4 100644 --- a/searchlib/src/vespa/searchlib/features/raw_score_feature.cpp +++ b/searchlib/src/vespa/searchlib/features/raw_score_feature.cpp @@ -35,7 +35,7 @@ RawScoreExecutor::execute(uint32_t docId) } void -RawScoreExecutor::handle_bind_match_data(fef::MatchData &md) +RawScoreExecutor::handle_bind_match_data(const fef::MatchData &md) { _md = &md; } diff --git a/searchlib/src/vespa/searchlib/features/raw_score_feature.h b/searchlib/src/vespa/searchlib/features/raw_score_feature.h index 8bb310fa18e..0eceba16ffe 100644 --- a/searchlib/src/vespa/searchlib/features/raw_score_feature.h +++ b/searchlib/src/vespa/searchlib/features/raw_score_feature.h @@ -14,7 +14,7 @@ private: std::vector<fef::TermFieldHandle> _handles; const fef::MatchData *_md; - void handle_bind_match_data(fef::MatchData &md) override; + void handle_bind_match_data(const fef::MatchData &md) override; public: RawScoreExecutor(const fef::IQueryEnvironment &env, uint32_t fieldId); void execute(uint32_t docId) override; diff --git a/searchlib/src/vespa/searchlib/features/reverseproximityfeature.cpp b/searchlib/src/vespa/searchlib/features/reverseproximityfeature.cpp index 0f35e1becf8..c27936332d2 100644 --- a/searchlib/src/vespa/searchlib/features/reverseproximityfeature.cpp +++ b/searchlib/src/vespa/searchlib/features/reverseproximityfeature.cpp @@ -90,7 +90,7 @@ ReverseProximityExecutor::execute(uint32_t docId) } void -ReverseProximityExecutor::handle_bind_match_data(fef::MatchData &md) +ReverseProximityExecutor::handle_bind_match_data(const fef::MatchData &md) { _md = &md; } diff --git a/searchlib/src/vespa/searchlib/features/reverseproximityfeature.h b/searchlib/src/vespa/searchlib/features/reverseproximityfeature.h index c16448435f2..776dde39f77 100644 --- a/searchlib/src/vespa/searchlib/features/reverseproximityfeature.h +++ b/searchlib/src/vespa/searchlib/features/reverseproximityfeature.h @@ -39,7 +39,7 @@ private: fef::TermFieldHandle _termB; // Handle to the second query term. const fef::MatchData *_md; - void handle_bind_match_data(fef::MatchData &md) override; + void handle_bind_match_data(const fef::MatchData &md) override; }; /** diff --git a/searchlib/src/vespa/searchlib/features/subqueries_feature.cpp b/searchlib/src/vespa/searchlib/features/subqueries_feature.cpp index 4bbb7af9dfb..6c52b6edb76 100644 --- a/searchlib/src/vespa/searchlib/features/subqueries_feature.cpp +++ b/searchlib/src/vespa/searchlib/features/subqueries_feature.cpp @@ -37,7 +37,7 @@ void SubqueriesExecutor::execute(uint32_t docId) { } void -SubqueriesExecutor::handle_bind_match_data(fef::MatchData &md) +SubqueriesExecutor::handle_bind_match_data(const fef::MatchData &md) { _md = &md; } diff --git a/searchlib/src/vespa/searchlib/features/subqueries_feature.h b/searchlib/src/vespa/searchlib/features/subqueries_feature.h index 60bec51cb79..136d8d90f94 100644 --- a/searchlib/src/vespa/searchlib/features/subqueries_feature.h +++ b/searchlib/src/vespa/searchlib/features/subqueries_feature.h @@ -12,7 +12,7 @@ class SubqueriesExecutor : public fef::FeatureExecutor { std::vector<fef::TermFieldHandle> _handles; const fef::MatchData *_md; - void handle_bind_match_data(fef::MatchData &md) override; + void handle_bind_match_data(const fef::MatchData &md) override; public: SubqueriesExecutor(const fef::IQueryEnvironment &env, uint32_t fieldId); void execute(uint32_t docId) override; diff --git a/searchlib/src/vespa/searchlib/features/term_field_md_feature.cpp b/searchlib/src/vespa/searchlib/features/term_field_md_feature.cpp index 97d267071cf..8b0eecd9cff 100644 --- a/searchlib/src/vespa/searchlib/features/term_field_md_feature.cpp +++ b/searchlib/src/vespa/searchlib/features/term_field_md_feature.cpp @@ -65,7 +65,7 @@ TermFieldMdExecutor::execute(uint32_t docId) } void -TermFieldMdExecutor::handle_bind_match_data(MatchData &md) +TermFieldMdExecutor::handle_bind_match_data(const MatchData &md) { _md = &md; } diff --git a/searchlib/src/vespa/searchlib/features/term_field_md_feature.h b/searchlib/src/vespa/searchlib/features/term_field_md_feature.h index f819989fc08..df9ab982dcb 100644 --- a/searchlib/src/vespa/searchlib/features/term_field_md_feature.h +++ b/searchlib/src/vespa/searchlib/features/term_field_md_feature.h @@ -21,7 +21,7 @@ class TermFieldMdExecutor : public fef::FeatureExecutor { const fef::MatchData *_md; void execute(uint32_t docId) override; - void handle_bind_match_data(fef::MatchData &md) override; + void handle_bind_match_data(const fef::MatchData &md) override; public: TermFieldMdExecutor(const fef::IQueryEnvironment &env, uint32_t fieldId); }; diff --git a/searchlib/src/vespa/searchlib/features/termdistancefeature.cpp b/searchlib/src/vespa/searchlib/features/termdistancefeature.cpp index a67c6a0be7c..0408f6d4b75 100644 --- a/searchlib/src/vespa/searchlib/features/termdistancefeature.cpp +++ b/searchlib/src/vespa/searchlib/features/termdistancefeature.cpp @@ -42,7 +42,7 @@ TermDistanceExecutor::execute(uint32_t docId) } void -TermDistanceExecutor::handle_bind_match_data(fef::MatchData &md) +TermDistanceExecutor::handle_bind_match_data(const fef::MatchData &md) { _md = &md; } diff --git a/searchlib/src/vespa/searchlib/features/termdistancefeature.h b/searchlib/src/vespa/searchlib/features/termdistancefeature.h index 5c4542a1f0d..8e153072bc2 100644 --- a/searchlib/src/vespa/searchlib/features/termdistancefeature.h +++ b/searchlib/src/vespa/searchlib/features/termdistancefeature.h @@ -31,7 +31,7 @@ private: QueryTerm _termB; const fef::MatchData *_md; - virtual void handle_bind_match_data(fef::MatchData &md) override; + virtual void handle_bind_match_data(const fef::MatchData &md) override; public: TermDistanceExecutor(const fef::IQueryEnvironment & env, diff --git a/searchlib/src/vespa/searchlib/features/termeditdistancefeature.cpp b/searchlib/src/vespa/searchlib/features/termeditdistancefeature.cpp index 05bdbb4475b..5990d62cb25 100644 --- a/searchlib/src/vespa/searchlib/features/termeditdistancefeature.cpp +++ b/searchlib/src/vespa/searchlib/features/termeditdistancefeature.cpp @@ -156,7 +156,7 @@ TermEditDistanceExecutor::execute(uint32_t docId) } void -TermEditDistanceExecutor::handle_bind_match_data(fef::MatchData &md) +TermEditDistanceExecutor::handle_bind_match_data(const fef::MatchData &md) { _md = &md; } diff --git a/searchlib/src/vespa/searchlib/features/termeditdistancefeature.h b/searchlib/src/vespa/searchlib/features/termeditdistancefeature.h index 07d625726e0..ea5974495ea 100644 --- a/searchlib/src/vespa/searchlib/features/termeditdistancefeature.h +++ b/searchlib/src/vespa/searchlib/features/termeditdistancefeature.h @@ -88,7 +88,7 @@ private: */ void logRow(const std::vector<TedCell> &row, size_t numCols); - void handle_bind_match_data(fef::MatchData &md) override; + void handle_bind_match_data(const fef::MatchData &md) override; private: const TermEditDistanceConfig &_config; // The config for this executor. diff --git a/searchlib/src/vespa/searchlib/features/text_similarity_feature.cpp b/searchlib/src/vespa/searchlib/features/text_similarity_feature.cpp index 31876e4f1c9..a50f042b552 100644 --- a/searchlib/src/vespa/searchlib/features/text_similarity_feature.cpp +++ b/searchlib/src/vespa/searchlib/features/text_similarity_feature.cpp @@ -158,7 +158,7 @@ TextSimilarityExecutor::execute(uint32_t docId) } void -TextSimilarityExecutor::handle_bind_match_data(fef::MatchData &md) +TextSimilarityExecutor::handle_bind_match_data(const fef::MatchData &md) { _md = &md; } diff --git a/searchlib/src/vespa/searchlib/features/text_similarity_feature.h b/searchlib/src/vespa/searchlib/features/text_similarity_feature.h index e948589fc97..a660f3e3e30 100644 --- a/searchlib/src/vespa/searchlib/features/text_similarity_feature.h +++ b/searchlib/src/vespa/searchlib/features/text_similarity_feature.h @@ -35,7 +35,7 @@ private: vespalib::PriorityQueue<Item> _queue; const fef::MatchData *_md; - void handle_bind_match_data(fef::MatchData &md) override; + void handle_bind_match_data(const fef::MatchData &md) override; public: TextSimilarityExecutor(const fef::IQueryEnvironment &env, uint32_t field_id); diff --git a/searchlib/src/vespa/searchlib/fef/featureexecutor.cpp b/searchlib/src/vespa/searchlib/fef/featureexecutor.cpp index f8268d66e47..02d69fbc5ca 100644 --- a/searchlib/src/vespa/searchlib/fef/featureexecutor.cpp +++ b/searchlib/src/vespa/searchlib/fef/featureexecutor.cpp @@ -28,7 +28,7 @@ FeatureExecutor::handle_bind_outputs(vespalib::ArrayRef<NumberOrObject>) } void -FeatureExecutor::handle_bind_match_data(MatchData &) +FeatureExecutor::handle_bind_match_data(const MatchData &) { } @@ -47,7 +47,7 @@ FeatureExecutor::bind_outputs(vespalib::ArrayRef<NumberOrObject> outputs) } void -FeatureExecutor::bind_match_data(MatchData &md) +FeatureExecutor::bind_match_data(const MatchData &md) { handle_bind_match_data(md); } diff --git a/searchlib/src/vespa/searchlib/fef/featureexecutor.h b/searchlib/src/vespa/searchlib/fef/featureexecutor.h index 1d8e4bff0c4..c8219fada3b 100644 --- a/searchlib/src/vespa/searchlib/fef/featureexecutor.h +++ b/searchlib/src/vespa/searchlib/fef/featureexecutor.h @@ -98,7 +98,7 @@ private: protected: virtual void handle_bind_inputs(vespalib::ConstArrayRef<LazyValue> inputs); virtual void handle_bind_outputs(vespalib::ArrayRef<NumberOrObject> outputs); - virtual void handle_bind_match_data(MatchData &md); + virtual void handle_bind_match_data(const MatchData &md); /** * Execute this feature executor for the given document. @@ -117,7 +117,7 @@ public: // bind order per executor: inputs, outputs, match_data void bind_inputs(vespalib::ConstArrayRef<LazyValue> inputs); void bind_outputs(vespalib::ArrayRef<NumberOrObject> outputs); - void bind_match_data(MatchData &md); + void bind_match_data(const MatchData &md); const Inputs &inputs() const { return _inputs; } const Outputs &outputs() const { return _outputs; } diff --git a/searchlib/src/vespa/searchlib/fef/featureoverrider.cpp b/searchlib/src/vespa/searchlib/fef/featureoverrider.cpp index ad623c65c07..5209065fd62 100644 --- a/searchlib/src/vespa/searchlib/fef/featureoverrider.cpp +++ b/searchlib/src/vespa/searchlib/fef/featureoverrider.cpp @@ -40,7 +40,7 @@ FeatureOverrider::execute(uint32_t docId) } void -FeatureOverrider::handle_bind_match_data(MatchData &md) +FeatureOverrider::handle_bind_match_data(const MatchData &md) { _executor.bind_match_data(md); } diff --git a/searchlib/src/vespa/searchlib/fef/featureoverrider.h b/searchlib/src/vespa/searchlib/fef/featureoverrider.h index 3f2075ffbcb..89c397abfdb 100644 --- a/searchlib/src/vespa/searchlib/fef/featureoverrider.h +++ b/searchlib/src/vespa/searchlib/fef/featureoverrider.h @@ -24,7 +24,7 @@ private: uint32_t _outputIdx; feature_t _value; - virtual void handle_bind_match_data(MatchData &md) override; + virtual void handle_bind_match_data(const MatchData &md) override; virtual void handle_bind_inputs(vespalib::ConstArrayRef<LazyValue> inputs) override; virtual void handle_bind_outputs(vespalib::ArrayRef<NumberOrObject> outputs) override; diff --git a/searchlib/src/vespa/searchlib/fef/matchdata.cpp b/searchlib/src/vespa/searchlib/fef/matchdata.cpp index 4ce2a7c9299..0c589749112 100644 --- a/searchlib/src/vespa/searchlib/fef/matchdata.cpp +++ b/searchlib/src/vespa/searchlib/fef/matchdata.cpp @@ -11,6 +11,15 @@ MatchData::MatchData(const Params &cparams) { } +void +MatchData::soft_reset() +{ + for (auto &tfmd: _termFields) { + tfmd.resetOnlyDocId(TermFieldMatchData::invalidId()).tagAsNeeded(); + } + _termwise_limit = 1.0; +} + MatchData::UP MatchData::makeTestInstance(uint32_t numTermFields, uint32_t fieldIdLimit) { diff --git a/searchlib/src/vespa/searchlib/fef/matchdata.h b/searchlib/src/vespa/searchlib/fef/matchdata.h index 472b34a823f..5b06f4d37e0 100644 --- a/searchlib/src/vespa/searchlib/fef/matchdata.h +++ b/searchlib/src/vespa/searchlib/fef/matchdata.h @@ -58,6 +58,15 @@ public: **/ explicit MatchData(const Params &cparams); + /** + * Reset this match data in such a way that it can be re-used with + * either the same search iterator tree or with a new search + * iterator tree where the only difference in interaction with the + * match data is which terms are unpacked. Note that this will + * reset some properties, but not all. Use with caution. + **/ + void soft_reset(); + MatchData(const MatchData &rhs) = delete; MatchData & operator=(const MatchData &rhs) = delete; diff --git a/searchlib/src/vespa/searchlib/fef/rank_program.cpp b/searchlib/src/vespa/searchlib/fef/rank_program.cpp index fa4582d46b7..33a65b48a1c 100644 --- a/searchlib/src/vespa/searchlib/fef/rank_program.cpp +++ b/searchlib/src/vespa/searchlib/fef/rank_program.cpp @@ -109,7 +109,7 @@ RankProgram::run_const(FeatureExecutor *executor) } void -RankProgram::unbox(BlueprintResolver::FeatureRef seed) +RankProgram::unbox(BlueprintResolver::FeatureRef seed, const MatchData &md) { FeatureExecutor *input_executor = _executors[seed.executor]; const NumberOrObject *input_value = input_executor->outputs().get_raw(seed.output); @@ -122,7 +122,7 @@ RankProgram::unbox(BlueprintResolver::FeatureRef seed) FeatureExecutor &unboxer = _hot_stash.create<UnboxingExecutor>(); unboxer.bind_inputs(inputs); unboxer.bind_outputs(outputs); - unboxer.bind_match_data(*_match_data); + unboxer.bind_match_data(md); _unboxed_seeds.emplace(input_value, LazyValue(&outputs[0], &unboxer)); } } @@ -153,7 +153,6 @@ RankProgram::resolve(const BlueprintResolver::FeatureMap &features, bool unbox_s RankProgram::RankProgram(BlueprintResolver::SP resolver) : _resolver(resolver), - _match_data(), _hot_stash(32768), _cold_stash(), _executors(), @@ -165,12 +164,11 @@ RankProgram::RankProgram(BlueprintResolver::SP resolver) RankProgram::~RankProgram() {} void -RankProgram::setup(const MatchDataLayout &mdl_in, +RankProgram::setup(const MatchData &md, const IQueryEnvironment &queryEnv, const Properties &featureOverrides) { assert(_executors.empty()); - _match_data = mdl_in.createMatchData(); std::vector<Override> overrides = prepare_overrides(_resolver->getFeatureMap(), featureOverrides); auto override = overrides.begin(); auto override_end = overrides.end(); @@ -204,7 +202,7 @@ RankProgram::setup(const MatchDataLayout &mdl_in, } executor->bind_inputs(inputs); executor->bind_outputs(outputs); - executor->bind_match_data(*_match_data); + executor->bind_match_data(md); _executors.push_back(executor); if (is_const) { run_const(executor); @@ -213,7 +211,7 @@ RankProgram::setup(const MatchDataLayout &mdl_in, for (const auto &seed_entry: _resolver->getSeedMap()) { auto seed = seed_entry.second; if (specs[seed.executor].output_types[seed.output]) { - unbox(seed); + unbox(seed, md); } } assert(_executors.size() == specs.size()); diff --git a/searchlib/src/vespa/searchlib/fef/rank_program.h b/searchlib/src/vespa/searchlib/fef/rank_program.h index 7cf593e4a4e..3a92fc874a4 100644 --- a/searchlib/src/vespa/searchlib/fef/rank_program.h +++ b/searchlib/src/vespa/searchlib/fef/rank_program.h @@ -6,7 +6,6 @@ #include "featureexecutor.h" #include "properties.h" #include "matchdata.h" -#include "matchdatalayout.h" #include "feature_resolver.h" #include <vespa/vespalib/stllike/string.h> #include <vespa/vespalib/util/array.h> @@ -21,11 +20,10 @@ namespace fef { * values. In order to access (and thereby calculate) output features * you typically use the get_seeds function to resolve the predefined * set of output features. Each feature value will be wrapped in a - * LazyValue object that can be realized for a specific docid. The - * rank program also owns the MatchData used to store unpacked - * term-field match information. Note that you need unpack any - * relevant posting information into the MatchData object before - * trying to resolve lazy values. + * LazyValue object that can be realized for a specific docid. Note + * that you need unpack any relevant posting information into the + * MatchData object passed to the setup function before trying to + * resolve lazy values. **/ class RankProgram { @@ -37,7 +35,6 @@ private: using ValueSet = std::set<const NumberOrObject *>; BlueprintResolver::SP _resolver; - MatchData::UP _match_data; vespalib::Stash _hot_stash; vespalib::Stash _cold_stash; std::vector<FeatureExecutor *> _executors; @@ -47,7 +44,7 @@ private: bool check_const(const NumberOrObject *value) const { return (_is_const.count(value) == 1); } bool check_const(FeatureExecutor *executor, const std::vector<BlueprintResolver::FeatureRef> &inputs) const; void run_const(FeatureExecutor *executor); - void unbox(BlueprintResolver::FeatureRef seed); + void unbox(BlueprintResolver::FeatureRef seed, const MatchData &md); FeatureResolver resolve(const BlueprintResolver::FeatureMap &features, bool unbox_seeds) const; public: @@ -66,21 +63,13 @@ public: /** * Set up this rank program by creating the needed feature * executors and wiring them together. This function will also - * create the MatchData to be used for iterator unpacking as well - * as pre-calculating all constant features. + * pre-calculate all constant features. **/ - void setup(const MatchDataLayout &mdl, + void setup(const MatchData &md, const IQueryEnvironment &queryEnv, const Properties &featureOverrides = Properties()); /** - * Expose the MatchData used when creating search iterators as it - * is where all iterators should unpack their match information. - **/ - MatchData &match_data() { return *_match_data; } - const MatchData &match_data() const { return *_match_data; } - - /** * Obtain the names and storage locations of all seed features for * this rank program. Programs for ranking phases will only have a * single seed while programs used for summary features or diff --git a/searchlib/src/vespa/searchlib/fef/termfieldmatchdata.h b/searchlib/src/vespa/searchlib/fef/termfieldmatchdata.h index 2d91764f7c9..018af889557 100644 --- a/searchlib/src/vespa/searchlib/fef/termfieldmatchdata.h +++ b/searchlib/src/vespa/searchlib/fef/termfieldmatchdata.h @@ -258,6 +258,13 @@ public: } /** + * Tag that this instance is used for ranking. + */ + void tagAsNeeded() { + _fieldId = _fieldId & ~0x2000; + } + + /** * Special docId value indicating that no data has been saved yet. * This should match (or be above) endId() in search::queryeval::SearchIterator. * diff --git a/searchlib/src/vespa/searchlib/fef/test/featuretest.cpp b/searchlib/src/vespa/searchlib/fef/test/featuretest.cpp index 2652abf97a4..e5a6232ed54 100644 --- a/searchlib/src/vespa/searchlib/fef/test/featuretest.cpp +++ b/searchlib/src/vespa/searchlib/fef/test/featuretest.cpp @@ -22,6 +22,7 @@ FeatureTest::FeatureTest(BlueprintFactory &factory, _layout(layout), _overrides(overrides), _resolver(new BlueprintResolver(factory, indexEnv)), + _match_data(_layout.createMatchData()), _rankProgram(new RankProgram(_resolver)), _doneSetup(false) { @@ -42,6 +43,7 @@ FeatureTest::FeatureTest(BlueprintFactory &factory, _layout(layout), _overrides(overrides), _resolver(new BlueprintResolver(factory, indexEnv)), + _match_data(_layout.createMatchData()), _rankProgram(new RankProgram(_resolver)), _doneSetup(false) { @@ -68,7 +70,7 @@ FeatureTest::setup() return false; } - _rankProgram->setup(_layout, _queryEnv, _overrides); + _rankProgram->setup(*_match_data, _queryEnv, _overrides); _doneSetup = true; return true; } @@ -77,7 +79,7 @@ MatchDataBuilder::UP FeatureTest::createMatchDataBuilder() { if (_doneSetup) { - return MatchDataBuilder::UP(new MatchDataBuilder(_queryEnv, _rankProgram->match_data())); + return MatchDataBuilder::UP(new MatchDataBuilder(_queryEnv, *_match_data)); } LOG(warning, "Match data not initialized."); return MatchDataBuilder::UP(); @@ -135,6 +137,7 @@ void FeatureTest::clear() { _resolver = BlueprintResolver::SP(new BlueprintResolver(_factory, _indexEnv)); + _match_data = _layout.createMatchData(); _rankProgram.reset(new RankProgram(_resolver)); _doneSetup = false; } diff --git a/searchlib/src/vespa/searchlib/fef/test/featuretest.h b/searchlib/src/vespa/searchlib/fef/test/featuretest.h index 2bce63d357d..e354884c110 100644 --- a/searchlib/src/vespa/searchlib/fef/test/featuretest.h +++ b/searchlib/src/vespa/searchlib/fef/test/featuretest.h @@ -116,6 +116,7 @@ private: MatchDataLayout &_layout; const Properties &_overrides; BlueprintResolver::SP _resolver; + MatchData::UP _match_data; RankProgram::UP _rankProgram; bool _doneSetup; diff --git a/searchlib/src/vespa/searchlib/index/bitvectorkeys.h b/searchlib/src/vespa/searchlib/index/bitvectorkeys.h index a916d07228a..a6cd0022371 100644 --- a/searchlib/src/vespa/searchlib/index/bitvectorkeys.h +++ b/searchlib/src/vespa/searchlib/index/bitvectorkeys.h @@ -1,6 +1,4 @@ // Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -// Copyright (C) 1998-2003 Fast Search & Transfer ASA -// Copyright (C) 2003 Overture Services Norway AS #pragma once diff --git a/searchlib/src/vespa/searchlib/parsequery/simplequerystack.cpp b/searchlib/src/vespa/searchlib/parsequery/simplequerystack.cpp index 6274bd083de..a7b41476ec6 100644 --- a/searchlib/src/vespa/searchlib/parsequery/simplequerystack.cpp +++ b/searchlib/src/vespa/searchlib/parsequery/simplequerystack.cpp @@ -1,12 +1,5 @@ // Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -/** - * Creation date: 2000-05-15 - * Implementation of the simple query stack. - * - * Copyright (C) 1997-2003 Fast Search & Transfer ASA - * Copyright (C) 2003 Overture Services Norway AS - * ALL RIGHTS RESERVED - */ + #include "simplequerystack.h" #include <vespa/vespalib/util/compress.h> #include <vespa/vespalib/objects/nbo.h> diff --git a/searchlib/src/vespa/searchlib/parsequery/simplequerystack.h b/searchlib/src/vespa/searchlib/parsequery/simplequerystack.h index 1defce4c757..a9d99ca93f8 100644 --- a/searchlib/src/vespa/searchlib/parsequery/simplequerystack.h +++ b/searchlib/src/vespa/searchlib/parsequery/simplequerystack.h @@ -1,13 +1,5 @@ // Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -/** - * Creation date: 2000-05-15 - * - * Declaration of the SimpleQueryStack - * - * Copyright (C) 1997-2003 Fast Search & Transfer ASA - * Copyright (C) 2003 Overture Services Norway AS - * ALL RIGHTS RESERVED - */ + #pragma once #include <vespa/searchlib/parsequery/parse.h> diff --git a/searchlib/src/vespa/searchlib/parsequery/stackdumpiterator.cpp b/searchlib/src/vespa/searchlib/parsequery/stackdumpiterator.cpp index d6a4181b1de..ec34b2d3a84 100644 --- a/searchlib/src/vespa/searchlib/parsequery/stackdumpiterator.cpp +++ b/searchlib/src/vespa/searchlib/parsequery/stackdumpiterator.cpp @@ -1,11 +1,5 @@ // Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -/** - * Implementation of the simple query stack dump iterator. - * - * Copyright (C) 1997-2003 Fast Search & Transfer ASA - * Copyright (C) 2003 Overture Services Norway AS - * ALL RIGHTS RESERVED - */ + #include "stackdumpiterator.h" #include <vespa/vespalib/util/compress.h> #include <vespa/vespalib/objects/nbo.h> diff --git a/searchlib/src/vespa/searchlib/parsequery/stackdumpiterator.h b/searchlib/src/vespa/searchlib/parsequery/stackdumpiterator.h index ee0aec4b297..dbb4becc819 100644 --- a/searchlib/src/vespa/searchlib/parsequery/stackdumpiterator.h +++ b/searchlib/src/vespa/searchlib/parsequery/stackdumpiterator.h @@ -1,11 +1,5 @@ // Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -/** - * Declaration of the SimpleQueryStack dump iterator - * - * Copyright (C) 1997-2003 Fast Search & Transfer ASA - * Copyright (C) 2003 Overture Services Norway AS - * ALL RIGHTS RESERVED - */ + #pragma once #include <vespa/searchlib/parsequery/parse.h> diff --git a/searchlib/src/vespa/searchlib/predicate/predicate_hash.h b/searchlib/src/vespa/searchlib/predicate/predicate_hash.h index 5b295e8bb41..938b1bc5542 100644 --- a/searchlib/src/vespa/searchlib/predicate/predicate_hash.h +++ b/searchlib/src/vespa/searchlib/predicate/predicate_hash.h @@ -7,7 +7,7 @@ namespace search { namespace predicate { /** - * Hash function coming from the RISE code base, used in boolean search. + * Hash function used for predicate fields. */ struct PredicateHash { static uint64_t hash64(vespalib::stringref aKey) { diff --git a/searchlib/src/vespa/searchlib/queryeval/iterators.h b/searchlib/src/vespa/searchlib/queryeval/iterators.h index 7dfed494d69..79c91f6be39 100644 --- a/searchlib/src/vespa/searchlib/queryeval/iterators.h +++ b/searchlib/src/vespa/searchlib/queryeval/iterators.h @@ -1,6 +1,4 @@ // Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -// Copyright (C) 2002-2003 Fast Search & Transfer ASA -// Copyright (C) 2003 Overture Services Norway AS #pragma once diff --git a/searchlib/src/vespa/searchlib/queryeval/termwise_search.cpp b/searchlib/src/vespa/searchlib/queryeval/termwise_search.cpp index 13b1c8f1da6..e7df5aa6bae 100644 --- a/searchlib/src/vespa/searchlib/queryeval/termwise_search.cpp +++ b/searchlib/src/vespa/searchlib/queryeval/termwise_search.cpp @@ -11,17 +11,27 @@ template <bool IS_STRICT> struct TermwiseSearch : public SearchIterator { SearchIterator::UP search; - BitVector::UP result; + BitVector::UP result; + uint32_t my_beginid; + uint32_t my_first_hit; + + bool same_range(uint32_t beginid, uint32_t endid) const { + return ((beginid == my_beginid) && endid == getEndId()); + } TermwiseSearch(SearchIterator::UP search_in) - : search(std::move(search_in)), result() {} + : search(std::move(search_in)), result(), my_beginid(0), my_first_hit(0) {} Trinary is_strict() const override { return IS_STRICT ? Trinary::True : Trinary::False; } void initRange(uint32_t beginid, uint32_t endid) override { - SearchIterator::initRange(beginid, endid); - search->initRange(beginid, endid); - setDocId(std::max(getDocId(), search->getDocId())); - result = search->get_hits(beginid); + if (!same_range(beginid, endid)) { + my_beginid = beginid; + SearchIterator::initRange(beginid, endid); + search->initRange(beginid, endid); + my_first_hit = std::max(getDocId(), search->getDocId()); + result = search->get_hits(beginid); + } + setDocId(my_first_hit); } void doSeek(uint32_t docid) override { if (__builtin_expect(isAtEnd(docid), false)) { diff --git a/searchlib/src/vespa/searchlib/test/datastore/memstats.h b/searchlib/src/vespa/searchlib/test/datastore/memstats.h index 08960a2bb89..c7cc4be9a92 100644 --- a/searchlib/src/vespa/searchlib/test/datastore/memstats.h +++ b/searchlib/src/vespa/searchlib/test/datastore/memstats.h @@ -1,5 +1,4 @@ // Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -// Copyright 2017 Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. #pragma once diff --git a/searchlib/src/vespa/searchlib/util/comprbuffer.h b/searchlib/src/vespa/searchlib/util/comprbuffer.h index bb568073cbd..61928976acc 100644 --- a/searchlib/src/vespa/searchlib/util/comprbuffer.h +++ b/searchlib/src/vespa/searchlib/util/comprbuffer.h @@ -1,6 +1,4 @@ // Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -// Copyright (C) 1999-2003 Fast Search & Transfer ASA -// Copyright (C) 2003 Overture Services Norway AS #pragma once diff --git a/searchlib/src/vespa/searchlib/util/comprfile.cpp b/searchlib/src/vespa/searchlib/util/comprfile.cpp index 194bed95d58..8b17fd85753 100644 --- a/searchlib/src/vespa/searchlib/util/comprfile.cpp +++ b/searchlib/src/vespa/searchlib/util/comprfile.cpp @@ -1,6 +1,4 @@ // Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -// Copyright (C) 2002-2003 Fast Search & Transfer ASA -// Copyright (C) 2003 Overture Services Norway AS #include "comprfile.h" #include <vespa/vespalib/objects/nbostream.h> diff --git a/searchlib/src/vespa/searchlib/util/dirtraverse.cpp b/searchlib/src/vespa/searchlib/util/dirtraverse.cpp index 57c7eee164f..c414e9c82fd 100644 --- a/searchlib/src/vespa/searchlib/util/dirtraverse.cpp +++ b/searchlib/src/vespa/searchlib/util/dirtraverse.cpp @@ -1,6 +1,4 @@ // Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -// Copyright (C) 2002-2003 Fast Search & Transfer ASA -// Copyright (C) 2003 Overture Services Norway AS #include "dirtraverse.h" #include <vespa/fastos/file.h> diff --git a/searchlib/src/vespa/searchlib/util/dirtraverse.h b/searchlib/src/vespa/searchlib/util/dirtraverse.h index ef37cfe871c..f2bf9cd6ffc 100644 --- a/searchlib/src/vespa/searchlib/util/dirtraverse.h +++ b/searchlib/src/vespa/searchlib/util/dirtraverse.h @@ -1,6 +1,4 @@ // Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -// Copyright (C) 2002-2003 Fast Search & Transfer ASA -// Copyright (C) 2003 Overture Services Norway AS #pragma once diff --git a/searchlib/src/vespa/searchlib/util/filekit.cpp b/searchlib/src/vespa/searchlib/util/filekit.cpp index 137210eb758..210a9c30134 100644 --- a/searchlib/src/vespa/searchlib/util/filekit.cpp +++ b/searchlib/src/vespa/searchlib/util/filekit.cpp @@ -1,6 +1,4 @@ // Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -// Copyright (C) 1998-2003 Fast Search & Transfer ASA -// Copyright (C) 2003 Overture Services Norway AS #include <vespa/searchlib/util/filekit.h> #include <vespa/vespalib/util/error.h> diff --git a/searchlib/src/vespa/searchlib/util/filekit.h b/searchlib/src/vespa/searchlib/util/filekit.h index 0c755ab50e5..70acf19c70c 100644 --- a/searchlib/src/vespa/searchlib/util/filekit.h +++ b/searchlib/src/vespa/searchlib/util/filekit.h @@ -1,6 +1,4 @@ // Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -// Copyright (C) 1998-2003 Fast Search & Transfer ASA -// Copyright (C) 2003 Overture Services Norway AS #pragma once diff --git a/searchlib/src/vespa/searchlib/util/rawbuf.cpp b/searchlib/src/vespa/searchlib/util/rawbuf.cpp index 7a23614df73..cf019014fd1 100644 --- a/searchlib/src/vespa/searchlib/util/rawbuf.cpp +++ b/searchlib/src/vespa/searchlib/util/rawbuf.cpp @@ -1,6 +1,4 @@ // Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -// Copyright (C) 1998-2003 Fast Search & Transfer ASA -// Copyright (C) 2003 Overture Services Norway AS #include "rawbuf.h" #include <vespa/vespalib/util/compress.h> diff --git a/searchlib/src/vespa/searchlib/util/rawbuf.h b/searchlib/src/vespa/searchlib/util/rawbuf.h index 123ceeaf5f7..ffebd035950 100644 --- a/searchlib/src/vespa/searchlib/util/rawbuf.h +++ b/searchlib/src/vespa/searchlib/util/rawbuf.h @@ -1,6 +1,4 @@ // Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -// Copyright (C) 1998-2003 Fast Search & Transfer ASA -// Copyright (C) 2003 Overture Services Norway AS #pragma once diff --git a/searchlib/src/vespa/searchlib/util/sort.h b/searchlib/src/vespa/searchlib/util/sort.h index 2362c219114..cc6eea32c6e 100644 --- a/searchlib/src/vespa/searchlib/util/sort.h +++ b/searchlib/src/vespa/searchlib/util/sort.h @@ -1,7 +1,4 @@ // Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -// Copyright (C) 1998-2003 Fast Search & Transfer ASA -// Copyright (C) 2003 Overture Services Norway AS - #pragma once diff --git a/searchlib/src/vespa/searchlib/util/stringenum.cpp b/searchlib/src/vespa/searchlib/util/stringenum.cpp index 2a29754443a..60238c32cc6 100644 --- a/searchlib/src/vespa/searchlib/util/stringenum.cpp +++ b/searchlib/src/vespa/searchlib/util/stringenum.cpp @@ -1,6 +1,4 @@ // Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -// Copyright (C) 2001-2003 Fast Search & Transfer ASA -// Copyright (C) 2003 Overture Services Norway AS #include "stringenum.h" #include <vespa/fastlib/io/bufferedfile.h> diff --git a/searchlib/src/vespa/searchlib/util/stringenum.h b/searchlib/src/vespa/searchlib/util/stringenum.h index 72040e5399c..44b3afca539 100644 --- a/searchlib/src/vespa/searchlib/util/stringenum.h +++ b/searchlib/src/vespa/searchlib/util/stringenum.h @@ -1,6 +1,4 @@ // Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -// Copyright (C) 2001-2003 Fast Search & Transfer ASA -// Copyright (C) 2003 Overture Services Norway AS #pragma once diff --git a/searchlib/src/vespa/searchlib/util/url.cpp b/searchlib/src/vespa/searchlib/util/url.cpp index 9c9a5ca5b51..6959f1fdff7 100644 --- a/searchlib/src/vespa/searchlib/util/url.cpp +++ b/searchlib/src/vespa/searchlib/util/url.cpp @@ -1,6 +1,4 @@ // Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -// Copyright (C) 2000-2003 Fast Search & Transfer ASA -// Copyright (C) 2003 Overture Services Norway AS #include "url.h" diff --git a/searchlib/src/vespa/searchlib/util/url.h b/searchlib/src/vespa/searchlib/util/url.h index 3bb81c266b7..6cf6f38af3b 100644 --- a/searchlib/src/vespa/searchlib/util/url.h +++ b/searchlib/src/vespa/searchlib/util/url.h @@ -1,6 +1,5 @@ // Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -// Copyright (C) 2000-2003 Fast Search & Transfer ASA -// Copyright (C) 2003 Overture Services Norway AS + #pragma once #ifndef MAX_URL_LEN |