mirror of
https://github.com/typesense/typesense.git
synced 2025-05-21 22:33:27 +08:00
Initialize thread locals earlier.
This commit is contained in:
parent
0e52f93b5a
commit
de07f89e47
@ -725,6 +725,11 @@ Option<nlohmann::json> Collection::search(const std::string & raw_query, const s
|
||||
|
||||
std::shared_lock lock(mutex);
|
||||
|
||||
// setup thread local vars
|
||||
search_stop_ms = search_stop_millis;
|
||||
search_begin = std::chrono::high_resolution_clock::now();
|
||||
search_cutoff = false;
|
||||
|
||||
if(raw_query != "*" && search_fields.empty()) {
|
||||
return Option<nlohmann::json>(400, "No search fields specified for the query.");
|
||||
}
|
||||
|
@ -2147,10 +2147,6 @@ void Index::search(std::vector<query_tokens_t>& field_query_tokens, const std::v
|
||||
const size_t max_extra_suffix, const size_t facet_query_num_typos,
|
||||
const bool filter_curated_hits, const bool split_join_tokens) const {
|
||||
|
||||
search_begin = std::chrono::high_resolution_clock::now();
|
||||
search_stop_ms = search_cutoff_ms;
|
||||
search_cutoff = false;
|
||||
|
||||
// process the filters
|
||||
|
||||
uint32_t* filter_ids = nullptr;
|
||||
|
Loading…
x
Reference in New Issue
Block a user