Skip to content

Commit

Permalink
Merge pull request #32972 from vespa-engine/toregge/remove-weakand-ra…
Browse files Browse the repository at this point in the history
…nge-from-rank-setup-and-create-blueprint-params

Remove weakand range from rank setup and create blueprint params.
  • Loading branch information
geirst authored Nov 29, 2024
2 parents c9cd655 + 1dff0de commit 2c40d77
Show file tree
Hide file tree
Showing 7 changed files with 2 additions and 39 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ class BlueprintBuilderVisitor :

void buildWeakAnd(ProtonWeakAnd &n) {
auto *wand = new WeakAndBlueprint(n.getTargetNumHits(),
_requestContext.get_create_blueprint_params().weakand_range,
1.0 /* weakand_range */,
_requestContext.get_create_blueprint_params().weakand_stop_word_strategy,
is_search_multi_threaded());
Blueprint::UP result(wand);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -353,7 +353,6 @@ MatchToolsFactory::extract_create_blueprint_params(const RankSetup& rank_setup,
double upper_limit = GlobalFilterUpperLimit::lookup(rank_properties, rank_setup.get_global_filter_upper_limit());
double target_hits_max_adjustment_factor = TargetHitsMaxAdjustmentFactor::lookup(rank_properties, rank_setup.get_target_hits_max_adjustment_factor());
auto fuzzy_matching_algorithm = FuzzyAlgorithm::lookup(rank_properties, rank_setup.get_fuzzy_matching_algorithm());
double weakand_range = temporary::WeakAndRange::lookup(rank_properties, rank_setup.get_weakand_range());
double weakand_stop_word_adjust_limit = WeakAndStopWordAdjustLimit::lookup(rank_properties, rank_setup.get_weakand_stop_word_adjust_limit());
double weakand_stop_word_drop_limit = WeakAndStopWordDropLimit::lookup(rank_properties, rank_setup.get_weakand_stop_word_drop_limit());
double disk_index_bitvector_limit = DiskIndexBitvectorLimit::lookup(rank_properties, rank_setup.get_disk_index_bitvector_limit());
Expand All @@ -366,7 +365,6 @@ MatchToolsFactory::extract_create_blueprint_params(const RankSetup& rank_setup,
upper_limit * active_hit_ratio,
target_hits_max_adjustment_factor,
fuzzy_matching_algorithm,
weakand_range,
StopWordStrategy(weakand_stop_word_adjust_limit,
weakand_stop_word_drop_limit, docid_limit),
disk_index_bitvector_limit};
Expand Down
15 changes: 0 additions & 15 deletions searchlib/src/vespa/searchlib/fef/indexproperties.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -185,21 +185,6 @@ namespace onsummary {

namespace temporary {

const std::string WeakAndRange::NAME("vespa.weakand.range");
const double WeakAndRange::DEFAULT_VALUE(1.0);

double
WeakAndRange::lookup(const Properties &props)
{
return lookup(props, DEFAULT_VALUE);
}

double
WeakAndRange::lookup(const Properties &props, double defaultValue)
{
return lookupDouble(props, NAME, defaultValue);
}

}

namespace mutate {
Expand Down
13 changes: 1 addition & 12 deletions searchlib/src/vespa/searchlib/fef/indexproperties.h
Original file line number Diff line number Diff line change
Expand Up @@ -180,18 +180,7 @@ namespace mutate {

// Add temporary flags used for safe rollout of new features here
namespace temporary {
/**
* A number in the range [0,1] for the effective idf range for WeakAndOperator.
* 1.0 will give the complete range as used by default by bm25.
* scaled_idf = (1.0 - range) * max_idf + (range * idf)
* 0.0 which is default gives default legacy behavior.
**/
struct WeakAndRange {
static const std::string NAME;
static const double DEFAULT_VALUE;
static double lookup(const Properties &props);
static double lookup(const Properties &props, double defaultValue);
};

}

namespace mutate::on_match {
Expand Down
2 changes: 0 additions & 2 deletions searchlib/src/vespa/searchlib/fef/ranksetup.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,6 @@ RankSetup::RankSetup(const BlueprintFactory &factory, const IIndexEnvironment &i
_global_filter_lower_limit(0.0),
_global_filter_upper_limit(1.0),
_target_hits_max_adjustment_factor(20.0),
_weakand_range(0.0),
_weakand_stop_word_adjust_limit(matching::WeakAndStopWordAdjustLimit::DEFAULT_VALUE),
_weakand_stop_word_drop_limit(matching::WeakAndStopWordDropLimit::DEFAULT_VALUE),
_disk_index_bitvector_limit(matching::DiskIndexBitvectorLimit::DEFAULT_VALUE),
Expand Down Expand Up @@ -134,7 +133,6 @@ RankSetup::configure()
set_global_filter_upper_limit(matching::GlobalFilterUpperLimit::lookup(_indexEnv.getProperties()));
set_target_hits_max_adjustment_factor(matching::TargetHitsMaxAdjustmentFactor::lookup(_indexEnv.getProperties()));
set_fuzzy_matching_algorithm(matching::FuzzyAlgorithm::lookup(_indexEnv.getProperties()));
set_weakand_range(temporary::WeakAndRange::lookup(_indexEnv.getProperties()));
set_weakand_stop_word_adjust_limit(matching::WeakAndStopWordAdjustLimit::lookup(_indexEnv.getProperties()));
set_weakand_stop_word_drop_limit(matching::WeakAndStopWordDropLimit::lookup(_indexEnv.getProperties()));
set_disk_index_bitvector_limit(matching::DiskIndexBitvectorLimit::lookup(_indexEnv.getProperties()));
Expand Down
3 changes: 0 additions & 3 deletions searchlib/src/vespa/searchlib/fef/ranksetup.h
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,6 @@ class RankSetup
double _global_filter_lower_limit;
double _global_filter_upper_limit;
double _target_hits_max_adjustment_factor;
double _weakand_range;
double _weakand_stop_word_adjust_limit;
double _weakand_stop_word_drop_limit;
double _disk_index_bitvector_limit;
Expand Down Expand Up @@ -413,8 +412,6 @@ class RankSetup
double get_target_hits_max_adjustment_factor() const { return _target_hits_max_adjustment_factor; }
void set_fuzzy_matching_algorithm(vespalib::FuzzyMatchingAlgorithm v) { _fuzzy_matching_algorithm = v; }
vespalib::FuzzyMatchingAlgorithm get_fuzzy_matching_algorithm() const { return _fuzzy_matching_algorithm; }
void set_weakand_range(double v) { _weakand_range = v; }
double get_weakand_range() const { return _weakand_range; }
void set_weakand_stop_word_adjust_limit(double v) { _weakand_stop_word_adjust_limit = v; }
double get_weakand_stop_word_adjust_limit() const { return _weakand_stop_word_adjust_limit; }
void set_weakand_stop_word_drop_limit(double v) { _weakand_stop_word_drop_limit = v; }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,22 +17,19 @@ struct CreateBlueprintParams
double global_filter_upper_limit;
double target_hits_max_adjustment_factor;
vespalib::FuzzyMatchingAlgorithm fuzzy_matching_algorithm;
double weakand_range;
queryeval::wand::StopWordStrategy weakand_stop_word_strategy;
double disk_index_bitvector_limit;

CreateBlueprintParams(double global_filter_lower_limit_in,
double global_filter_upper_limit_in,
double target_hits_max_adjustment_factor_in,
vespalib::FuzzyMatchingAlgorithm fuzzy_matching_algorithm_in,
double weakand_range_in,
queryeval::wand::StopWordStrategy weakand_stop_word_strategy_in,
double disk_index_bitvector_limit_in)
: global_filter_lower_limit(global_filter_lower_limit_in),
global_filter_upper_limit(global_filter_upper_limit_in),
target_hits_max_adjustment_factor(target_hits_max_adjustment_factor_in),
fuzzy_matching_algorithm(fuzzy_matching_algorithm_in),
weakand_range(weakand_range_in),
weakand_stop_word_strategy(weakand_stop_word_strategy_in),
disk_index_bitvector_limit(disk_index_bitvector_limit_in)
{
Expand All @@ -43,7 +40,6 @@ struct CreateBlueprintParams
fef::indexproperties::matching::GlobalFilterUpperLimit::DEFAULT_VALUE,
fef::indexproperties::matching::TargetHitsMaxAdjustmentFactor::DEFAULT_VALUE,
fef::indexproperties::matching::FuzzyAlgorithm::DEFAULT_VALUE,
fef::indexproperties::temporary::WeakAndRange::DEFAULT_VALUE,
queryeval::wand::StopWordStrategy::none(),
fef::indexproperties::matching::DiskIndexBitvectorLimit::DEFAULT_VALUE)
{
Expand Down

0 comments on commit 2c40d77

Please sign in to comment.