diff --git a/ModelSearchEngine.cpp b/ModelSearchEngine.cpp index 37dbb76..ce9da9d 100644 --- a/ModelSearchEngine.cpp +++ b/ModelSearchEngine.cpp @@ -125,7 +125,6 @@ void ModelSearchEngine::SearchSessionModels(const ModelSearchRequest& request, s // Create search result item SearchResultItem item; item.model_name = model_name; - item.display_name = model_name; item.full_path = model_name; // 对于会话中的根模型,路径就是模型名 item.file_path = file_path; // 物理文件路径 item.model_type = model_type; @@ -202,7 +201,6 @@ void ModelSearchEngine::SearchFromRootAssemblies(const ModelSearchRequest& reque if (match_score >= request.similarity_threshold) { SearchResultItem item; item.model_name = root_name; - item.display_name = root_name; item.full_path = root_name; // Root assembly path item.file_path = GetModelFilePath(model); item.model_type = "ASSEMBLY"; @@ -275,7 +273,6 @@ void ModelSearchEngine::SearchCurrentModel(const ModelSearchRequest& request, st SearchResultItem item; item.model_name = model_name; - item.display_name = model_name; item.full_path = model_name; // 当前模型的路径就是模型名 item.file_path = file_path; // 物理文件路径 item.model_type = GetModelTypeString(current_model); @@ -385,11 +382,9 @@ void ModelSearchEngine::SearchAssemblyComponents(const ModelSearchRequest& reque if (match_score >= request.similarity_threshold) { SearchResultItem item; item.model_name = comp_name; - item.display_name = comp_name; item.full_path = tree_path; // Model tree hierarchy path item.file_path = comp_file; // Physical file path item.model_type = model_type; - item.component_path = BuildComponentPath(parent_path, comp_name); item.match_score = match_score; item.match_type = "component"; item.is_in_session = true; @@ -502,11 +497,9 @@ void ModelSearchEngine::SearchAssemblyComponentsWithDedup(const ModelSearchReque if (match_score >= request.similarity_threshold) { SearchResultItem item; item.model_name = comp_name; - item.display_name = comp_name; item.full_path = tree_path; // Model tree hierarchy path item.file_path = comp_file; // Physical file path item.model_type = model_type; - item.component_path = BuildComponentPath(parent_path, comp_name); item.match_score = match_score; item.match_type = "component"; item.is_in_session = true; diff --git a/ModelSearchEngine.h b/ModelSearchEngine.h index b366883..6ca8cc6 100644 --- a/ModelSearchEngine.h +++ b/ModelSearchEngine.h @@ -48,21 +48,15 @@ struct ModelSearchRequest { // 搜索结果项结构 struct SearchResultItem { std::string model_name; // 模型名称 - std::string display_name; // 显示名称 std::string full_path; // 模型树中的完整路径 std::string file_path; // 文件路径 (GetOrigin) std::string model_type; // 模型类型 ("PART", "ASSEMBLY", "DRAWING") - std::string component_path; // 组件路径(装配体中的位置) double match_score; // 匹配分数 (0.0-1.0) std::string match_reason; // 匹配原因说明 std::string match_type; // 匹配类型 ("name", "component", "feature") bool is_in_session; // 是否在当前会话中 bool is_assembly; // 是否是装配体 int component_count; // 组件数量(装配体) - - // 扩展信息 - std::string file_size; // 文件大小 - std::string last_modified; // 最后修改时间 std::vector matched_keywords; // 匹配的关键词 // 构造函数 diff --git a/ModelSearchHandler.cpp b/ModelSearchHandler.cpp index 573293a..d5eec61 100644 --- a/ModelSearchHandler.cpp +++ b/ModelSearchHandler.cpp @@ -123,18 +123,15 @@ HttpResponse ModelSearchHandler::FormatSuccessResponse(const ModelSearchResult& json << "{" << "\"model_name\": \"" << EscapeJsonString(item.model_name) << "\"," - << "\"display_name\": \"" << EscapeJsonString(item.display_name) << "\"," << "\"full_path\": \"" << EscapeJsonString(item.full_path) << "\"," + << "\"file_path\": \"" << EscapeJsonString(item.file_path) << "\"," << "\"model_type\": \"" << EscapeJsonString(item.model_type) << "\"," - << "\"component_path\": \"" << EscapeJsonString(item.component_path) << "\"," << "\"match_score\": " << item.match_score << "," << "\"match_reason\": \"" << EscapeJsonString(item.match_reason) << "\"," << "\"match_type\": \"" << EscapeJsonString(item.match_type) << "\"," << "\"is_in_session\": " << (item.is_in_session ? "true" : "false") << "," << "\"is_assembly\": " << (item.is_assembly ? "true" : "false") << "," << "\"component_count\": " << item.component_count << "," - << "\"file_size\": \"" << EscapeJsonString(item.file_size) << "\"," - << "\"last_modified\": \"" << EscapeJsonString(item.last_modified) << "\"," << "\"matched_keywords\": ["; // Build matched keywords list