Commit 97a5d59da1145aebba9496e9d2921f4034bce488
1 parent
b2d89de1
文档修改
Showing
3 changed files
with
38 additions
and
17 deletions
Show diff stats
CLAUDE.md
| @@ -54,10 +54,6 @@ The system uses two types of configurations per tenant: | @@ -54,10 +54,6 @@ The system uses two types of configurations per tenant: | ||
| 54 | - Query domain definitions (default, category_name, title, brand_name, etc.) | 54 | - Query domain definitions (default, category_name, title, brand_name, etc.) |
| 55 | - BM25 parameters and similarity configurations | 55 | - BM25 parameters and similarity configurations |
| 56 | 56 | ||
| 57 | -Reference files: | ||
| 58 | -- `商品数据源入ES配置规范.md` - ES mapping and analyzer configuration standards | ||
| 59 | -- `阿里opensearch电商行业.md` - Application and index structure examples from Alibaba OpenSearch | ||
| 60 | - | ||
| 61 | ### Query Processing | 57 | ### Query Processing |
| 62 | 58 | ||
| 63 | The `queryParser` performs: | 59 | The `queryParser` performs: |
docs/搜索API对接指南.md
| @@ -25,42 +25,47 @@ | @@ -25,42 +25,47 @@ | ||
| 25 | ### 最简单的搜索请求 | 25 | ### 最简单的搜索请求 |
| 26 | 26 | ||
| 27 | ```bash | 27 | ```bash |
| 28 | -curl -X POST "http://localhost:6002/search/" \ | 28 | +curl -X POST "http://120.76.41.98:6002/search/" \ |
| 29 | -H "Content-Type: application/json" \ | 29 | -H "Content-Type: application/json" \ |
| 30 | - -d '{ | ||
| 31 | - "query": "芭比娃娃" | ||
| 32 | - }' | 30 | + -H "X-Tenant-ID: 2" \ |
| 31 | + -d '{"query": "芭比娃娃"}' | ||
| 33 | ``` | 32 | ``` |
| 34 | 33 | ||
| 35 | ### curl示例:带过滤与分页 | 34 | ### curl示例:带过滤与分页 |
| 36 | 35 | ||
| 37 | ```bash | 36 | ```bash |
| 38 | -curl -X POST "http://localhost:6002/search/" \ | 37 | +curl -X POST "http://120.76.41.98:6002/search/" \ |
| 39 | -H "Content-Type: application/json" \ | 38 | -H "Content-Type: application/json" \ |
| 39 | + -H "X-Tenant-ID: 2" \ | ||
| 40 | -d '{ | 40 | -d '{ |
| 41 | - "tenant_id": "demo-tenant", | ||
| 42 | - "query": "芭比娃娃 AND 配件", | 41 | + "query": "芭比娃娃", |
| 43 | "size": 5, | 42 | "size": 5, |
| 44 | "from": 10, | 43 | "from": 10, |
| 45 | - "filters": { | ||
| 46 | - "vendor.keyword": ["乐高", "孩之宝"] | 44 | + "range_filters": { |
| 45 | + "min_price": { | ||
| 46 | + "gte": 50, | ||
| 47 | + "lte": 200 | ||
| 47 | }, | 48 | }, |
| 49 | + "create_time": { | ||
| 50 | + "gte": "2020-01-01T00:00:00Z" | ||
| 51 | + } | ||
| 52 | + }, | ||
| 48 | "sort_by": "min_price", | 53 | "sort_by": "min_price", |
| 49 | "sort_order": "asc" | 54 | "sort_order": "asc" |
| 50 | }' | 55 | }' |
| 51 | ``` | 56 | ``` |
| 52 | 57 | ||
| 53 | -### curl示例:开启调试与分面 | 58 | +### curl示例:开启分面 |
| 54 | 59 | ||
| 55 | ```bash | 60 | ```bash |
| 56 | -curl -X POST "http://localhost:6002/search/" \ | 61 | +curl -X POST "http://120.76.41.98:6002/search/" \ |
| 57 | -H "Content-Type: application/json" \ | 62 | -H "Content-Type: application/json" \ |
| 63 | + -H "X-Tenant-ID: 2" \ | ||
| 58 | -d '{ | 64 | -d '{ |
| 59 | "tenant_id": "demo-tenant", | 65 | "tenant_id": "demo-tenant", |
| 60 | "query": "芭比娃娃", | 66 | "query": "芭比娃娃", |
| 61 | "facets": ["category.keyword", "vendor.keyword"], | 67 | "facets": ["category.keyword", "vendor.keyword"], |
| 62 | - "min_score": 0.2, | ||
| 63 | - "debug": true | 68 | + "min_score": 0.2 |
| 64 | }' | 69 | }' |
| 65 | ``` | 70 | ``` |
| 66 | 71 |
docs/索引字段说明.md
| @@ -16,6 +16,26 @@ | @@ -16,6 +16,26 @@ | ||
| 16 | - 返回的结果格式约定为店匠系列的 SPU/SKU嵌套结构。 | 16 | - 返回的结果格式约定为店匠系列的 SPU/SKU嵌套结构。 |
| 17 | - 支撑 facet/过滤/排序业务需求:用户可以选择任何一个 keyword 或 HKText 类型的字段做筛选、聚合;也可以选择任何一个数值型字段做 Range 过滤或排序。 | 17 | - 支撑 facet/过滤/排序业务需求:用户可以选择任何一个 keyword 或 HKText 类型的字段做筛选、聚合;也可以选择任何一个数值型字段做 Range 过滤或排序。 |
| 18 | 18 | ||
| 19 | +## 数据源调研 | ||
| 20 | + | ||
| 21 | +店匠的商品结构: | ||
| 22 | + | ||
| 23 | +固定字段: | ||
| 24 | +1、必填:品名 | ||
| 25 | +2、非必填:副标题、类目、专辑、标签、供应商、市场 | ||
| 26 | + | ||
| 27 | +动态字段:商品属性 | ||
| 28 | +1、款式(一款,或者多款)这部分是可以动态自定义的 | ||
| 29 | +款式可以支持直接生成一个 SKU,也可以选择不启用 | ||
| 30 | +2、类目没有预设动态属性值,都是自定义的 | ||
| 31 | + | ||
| 32 | +我们的目标客户店匠的两个店铺,男装和女装 | ||
| 33 | + | ||
| 34 | +商品信息:品名、颜色、尺码,基本上就这三个信息 | ||
| 35 | + | ||
| 36 | +spu/sku表: | ||
| 37 | + | ||
| 38 | + | ||
| 19 | ## 索引基本信息 | 39 | ## 索引基本信息 |
| 20 | 40 | ||
| 21 | - **索引名称**: `search_products` | 41 | - **索引名称**: `search_products` |