mirror of
https://github.com/typesense/typesense.git
synced 2025-05-21 14:12:27 +08:00
Update hybrid search info
This commit is contained in:
parent
29224dee82
commit
165371301d
@ -1957,17 +1957,13 @@ Option<nlohmann::json> Collection::search(std::string raw_query,
|
||||
if(field_order_kv->match_score_index == CURATED_RECORD_IDENTIFIER) {
|
||||
wrapper_doc["curated"] = true;
|
||||
} else if(field_order_kv->match_score_index >= 0) {
|
||||
if(vector_query.field_name.empty()) {
|
||||
wrapper_doc["text_match"] = field_order_kv->scores[field_order_kv->match_score_index];
|
||||
|
||||
wrapper_doc["text_match_info"] = nlohmann::json::object();
|
||||
populate_text_match_info(wrapper_doc["text_match_info"],
|
||||
field_order_kv->scores[field_order_kv->match_score_index], match_type);
|
||||
} else {
|
||||
wrapper_doc["text_match"] = field_order_kv->scores[field_order_kv->match_score_index];
|
||||
wrapper_doc["text_match_info"] = nlohmann::json::object();
|
||||
populate_text_match_info(wrapper_doc["text_match_info"],
|
||||
field_order_kv->scores[field_order_kv->match_score_index], match_type);
|
||||
if(!vector_query.field_name.empty()) {
|
||||
wrapper_doc["hybrid_search_info"] = nlohmann::json::object();
|
||||
wrapper_doc["hybrid_search_info"]["rank_fusion_score"] = Index::int64_t_to_float(field_order_kv->scores[field_order_kv->match_score_index]);
|
||||
wrapper_doc["hybrid_search_info"]["text_match_score"] = field_order_kv->text_match_score;
|
||||
wrapper_doc["hybrid_search_info"]["vector_distance"] = field_order_kv->vector_distance;
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user