Commit e7ad2b4aac17f1022e0ee49355dcbec1b874421a
1 parent
c973d288
测试页面分页配置
Showing
7 changed files
with
8 additions
and
19 deletions
Show diff stats
.cursor/plans/api-interface-analysis-42918612.plan.0.md
| @@ -632,7 +632,7 @@ def _standardize_facets( | @@ -632,7 +632,7 @@ def _standardize_facets( | ||
| 632 | # 构建标准化分面结果 | 632 | # 构建标准化分面结果 |
| 633 | facet = { | 633 | facet = { |
| 634 | "field": field, | 634 | "field": field, |
| 635 | - "label": self._get_field_label(field), # 从配置获取 | 635 | + "label": field, # 从配置获取 |
| 636 | "type": facet_type, | 636 | "type": facet_type, |
| 637 | "values": [] | 637 | "values": [] |
| 638 | } | 638 | } |
.cursor/plans/api-interface-analysis-42918612.plan.1.md
| @@ -632,7 +632,7 @@ def _standardize_facets( | @@ -632,7 +632,7 @@ def _standardize_facets( | ||
| 632 | # 构建标准化分面结果 | 632 | # 构建标准化分面结果 |
| 633 | facet = { | 633 | facet = { |
| 634 | "field": field, | 634 | "field": field, |
| 635 | - "label": self._get_field_label(field), # 从配置获取 | 635 | + "label": field, # 从配置获取 |
| 636 | "type": facet_type, | 636 | "type": facet_type, |
| 637 | "values": [] | 637 | "values": [] |
| 638 | } | 638 | } |
.cursor/plans/api-interface-analysis-42918612.plan.2.md
| @@ -632,7 +632,7 @@ def _standardize_facets( | @@ -632,7 +632,7 @@ def _standardize_facets( | ||
| 632 | # 构建标准化分面结果 | 632 | # 构建标准化分面结果 |
| 633 | facet = { | 633 | facet = { |
| 634 | "field": field, | 634 | "field": field, |
| 635 | - "label": self._get_field_label(field), # 从配置获取 | 635 | + "label": field, # 从配置获取 |
| 636 | "type": facet_type, | 636 | "type": facet_type, |
| 637 | "values": [] | 637 | "values": [] |
| 638 | } | 638 | } |
.cursor/plans/api-interface-analysis-42918612.plan.3.最终执行.md
| @@ -632,7 +632,7 @@ def _standardize_facets( | @@ -632,7 +632,7 @@ def _standardize_facets( | ||
| 632 | # 构建标准化分面结果 | 632 | # 构建标准化分面结果 |
| 633 | facet = { | 633 | facet = { |
| 634 | "field": field, | 634 | "field": field, |
| 635 | - "label": self._get_field_label(field), | 635 | + "label": field, |
| 636 | "type": facet_type, | 636 | "type": facet_type, |
| 637 | "values": [] | 637 | "values": [] |
| 638 | } | 638 | } |
api/models.py
| @@ -67,7 +67,7 @@ class SearchRequest(BaseModel): | @@ -67,7 +67,7 @@ class SearchRequest(BaseModel): | ||
| 67 | 67 | ||
| 68 | # 基础搜索参数 | 68 | # 基础搜索参数 |
| 69 | query: str = Field(..., description="搜索查询字符串,支持布尔表达式(AND, OR, RANK, ANDNOT)") | 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 | from_: int = Field(0, ge=0, alias="from", description="分页偏移量") | 71 | from_: int = Field(0, ge=0, alias="from", description="分页偏移量") |
| 72 | language: Literal["zh", "en"] = Field( | 72 | language: Literal["zh", "en"] = Field( |
| 73 | "zh", | 73 | "zh", |
frontend/index.html
| @@ -106,8 +106,8 @@ | @@ -106,8 +106,8 @@ | ||
| 106 | <select id="resultSize" onchange="performSearch()"> | 106 | <select id="resultSize" onchange="performSearch()"> |
| 107 | <option value="20">20 per page</option> | 107 | <option value="20">20 per page</option> |
| 108 | <option value="50" selected>50 per page</option> | 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 | </select> | 111 | </select> |
| 112 | </div> | 112 | </div> |
| 113 | </div> | 113 | </div> |
search/searcher.py
| @@ -651,7 +651,7 @@ class Searcher: | @@ -651,7 +651,7 @@ class Searcher: | ||
| 651 | # 构建 FacetResult 对象 | 651 | # 构建 FacetResult 对象 |
| 652 | facet_result = FacetResult( | 652 | facet_result = FacetResult( |
| 653 | field=field, | 653 | field=field, |
| 654 | - label=self._get_field_label(field), | 654 | + label=field, |
| 655 | type=facet_type, | 655 | type=facet_type, |
| 656 | values=facet_values | 656 | values=facet_values |
| 657 | ) | 657 | ) |
| @@ -659,14 +659,3 @@ class Searcher: | @@ -659,14 +659,3 @@ class Searcher: | ||
| 659 | standardized_facets.append(facet_result) | 659 | standardized_facets.append(facet_result) |
| 660 | 660 | ||
| 661 | return standardized_facets if standardized_facets else None | 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) |