Commit e7ad2b4aac17f1022e0ee49355dcbec1b874421a

Authored by tangwang
1 parent c973d288

测试页面分页配置

.cursor/plans/api-interface-analysis-42918612.plan.0.md
... ... @@ -632,7 +632,7 @@ def _standardize_facets(
632 632 # 构建标准化分面结果
633 633 facet = {
634 634 "field": field,
635   - "label": self._get_field_label(field), # 从配置获取
  635 + "label": field, # 从配置获取
636 636 "type": facet_type,
637 637 "values": []
638 638 }
... ...
.cursor/plans/api-interface-analysis-42918612.plan.1.md
... ... @@ -632,7 +632,7 @@ def _standardize_facets(
632 632 # 构建标准化分面结果
633 633 facet = {
634 634 "field": field,
635   - "label": self._get_field_label(field), # 从配置获取
  635 + "label": field, # 从配置获取
636 636 "type": facet_type,
637 637 "values": []
638 638 }
... ...
.cursor/plans/api-interface-analysis-42918612.plan.2.md
... ... @@ -632,7 +632,7 @@ def _standardize_facets(
632 632 # 构建标准化分面结果
633 633 facet = {
634 634 "field": field,
635   - "label": self._get_field_label(field), # 从配置获取
  635 + "label": field, # 从配置获取
636 636 "type": facet_type,
637 637 "values": []
638 638 }
... ...
.cursor/plans/api-interface-analysis-42918612.plan.3.最终执行.md
... ... @@ -632,7 +632,7 @@ def _standardize_facets(
632 632 # 构建标准化分面结果
633 633 facet = {
634 634 "field": field,
635   - "label": self._get_field_label(field),
  635 + "label": field,
636 636 "type": facet_type,
637 637 "values": []
638 638 }
... ...
api/models.py
... ... @@ -67,7 +67,7 @@ class SearchRequest(BaseModel):
67 67  
68 68 # 基础搜索参数
69 69 query: str = Field(..., description="搜索查询字符串,支持布尔表达式(AND, OR, RANK, ANDNOT)")
70   - size: int = Field(10, ge=1, le=100, description="返回结果数量")
  70 + size: int = Field(10, ge=1, le=1000, description="返回结果数量")
71 71 from_: int = Field(0, ge=0, alias="from", description="分页偏移量")
72 72 language: Literal["zh", "en"] = Field(
73 73 "zh",
... ...
frontend/index.html
... ... @@ -106,8 +106,8 @@
106 106 <select id="resultSize" onchange="performSearch()">
107 107 <option value="20">20 per page</option>
108 108 <option value="50" selected>50 per page</option>
109   - <option value="100">50 per page</option>
110   - <option value="200">50 per page</option>
  109 + <option value="100">100 per page</option>
  110 + <option value="200">200 per page</option>
111 111 </select>
112 112 </div>
113 113 </div>
... ...
search/searcher.py
... ... @@ -651,7 +651,7 @@ class Searcher:
651 651 # 构建 FacetResult 对象
652 652 facet_result = FacetResult(
653 653 field=field,
654   - label=self._get_field_label(field),
  654 + label=field,
655 655 type=facet_type,
656 656 values=facet_values
657 657 )
... ... @@ -659,14 +659,3 @@ class Searcher:
659 659 standardized_facets.append(facet_result)
660 660  
661 661 return standardized_facets if standardized_facets else None
662   -
663   - def _get_field_label(self, field: str) -> str:
664   - """获取字段的显示标签"""
665   - # 字段标签映射(简化版,不再从配置读取)
666   - field_labels = {
667   - "category1_name": "一级分类",
668   - "category2_name": "二级分类",
669   - "category3_name": "三级分类",
670   - "specifications": "规格"
671   - }
672   - return field_labels.get(field, field)
... ...