No search cutoff default if exhaustive search is used.

This commit is contained in:
Kishore Nallan 2021-11-17 21:09:55 +05:30
parent 58f3d4bf66
commit 866b5820f3

View File

@ -559,8 +559,8 @@ Option<bool> CollectionManager::do_search(std::map<std::string, std::string>& re
const char *PRIORITIZE_EXACT_MATCH = "prioritize_exact_match";
const char *PRE_SEGMENTED_QUERY = "pre_segmented_query";
const char *EXHAUSTIVE_SEARCH = "exhaustive_search";
const char *SEARCH_CUTOFF_MS = "search_cutoff_ms";
const char *EXHAUSTIVE_SEARCH = "exhaustive_search";
if(req_params.count(NUM_TYPOS) == 0) {
req_params[NUM_TYPOS] = "2";
@ -671,14 +671,17 @@ Option<bool> CollectionManager::do_search(std::map<std::string, std::string>& re
req_params[PRE_SEGMENTED_QUERY] = "false";
}
if(req_params.count(EXHAUSTIVE_SEARCH) == 0) {
req_params[EXHAUSTIVE_SEARCH] = "false";
}
if(req_params.count(SEARCH_CUTOFF_MS) == 0) {
req_params[SEARCH_CUTOFF_MS] = "2000";
}
if(req_params.count(EXHAUSTIVE_SEARCH) == 0) {
req_params[EXHAUSTIVE_SEARCH] = "false";
} else if(req_params[EXHAUSTIVE_SEARCH] == "true") {
// if exhaustive search is enabled, we won't enable search cut-off by default
req_params[SEARCH_CUTOFF_MS] = "3600000";
}
std::vector<std::string> query_by_weights_str;
std::vector<size_t> query_by_weights;