|
| 1 | + |
| 2 | +### 全文检索 |
| 3 | +* API: POST /api/v3/find/full_text |
| 4 | +* API名称: full_text_find |
| 5 | +* 功能说明: |
| 6 | + * 中文:全文检索 |
| 7 | + * English :full text find |
| 8 | +* input body: |
| 9 | +``` |
| 10 | +{ |
| 11 | + "page": { |
| 12 | + "start": 0, |
| 13 | + "limit": 10 |
| 14 | + }, |
| 15 | + "query_string": "wtop", |
| 16 | + "bk_obj_id": "test_search", |
| 17 | + "bk_biz_id": "2", |
| 18 | + "filter": ["model"] |
| 19 | +} |
| 20 | +``` |
| 21 | + |
| 22 | + |
| 23 | +* input字段说明: |
| 24 | + |
| 25 | +| 名称 | 类型 |必填| 默认值|说明 | Description| |
| 26 | +|---|---|---|---|---|---| |
| 27 | +| start| int|否|-1|分页开始| 分页开始| |
| 28 | +| limit| int|否|-1|分页大小| 分页大小| |
| 29 | +| query_string| string|否|无|检索内容 | query string content| |
| 30 | +| bk_obj_id| string|否|无|对象实例id| 指定对象| |
| 31 | +| bk_biz_id| string|否|无|业务id|指定业务| |
| 32 | +| filter| string list|否|空|过滤搜索表| 取值范围["model", "object", "host", "process", "application"]| |
| 33 | + |
| 34 | + |
| 35 | +* output: |
| 36 | + |
| 37 | +``` |
| 38 | +{ |
| 39 | + "result": true, |
| 40 | + "bk_error_code": 0, |
| 41 | + "bk_error_msg": "", |
| 42 | + "data": { |
| 43 | + "total": 1, |
| 44 | + "aggregations": [ |
| 45 | + { |
| 46 | + "key": "test_search", |
| 47 | + "count": 1 |
| 48 | + } |
| 49 | + ], |
| 50 | + "hits": [ |
| 51 | + { |
| 52 | + "source": { |
| 53 | + "bk_inst_id": 19, |
| 54 | + "bk_inst_name": "liow", |
| 55 | + "bk_obj_id": "test_search", |
| 56 | + "bk_supplier_account": "0", |
| 57 | + "bool_e": false, |
| 58 | + "char_a": "123wdw", |
| 59 | + "char_f": "awe", |
| 60 | + "enum_d": "1", |
| 61 | + "float_c": 23, |
| 62 | + "int_b": 123, |
| 63 | + "longchar_g": "wtop", |
| 64 | + "metadata": { |
| 65 | + "label": { |
| 66 | + "bk_biz_id": "2" |
| 67 | + } |
| 68 | + } |
| 69 | + }, |
| 70 | + "highlight": { |
| 71 | + "bk_obj_id": [ |
| 72 | + "<em>test_search</em>" |
| 73 | + ], |
| 74 | + "bk_obj_id.keyword": [ |
| 75 | + "<em>test_search</em>" |
| 76 | + ], |
| 77 | + "longchar_g": [ |
| 78 | + "<em>wtop</em>" |
| 79 | + ], |
| 80 | + "longchar_g.keyword": [ |
| 81 | + "<em>wtop</em>" |
| 82 | + ], |
| 83 | + "metadata.label.bk_biz_id": [ |
| 84 | + "<em>2</em>" |
| 85 | + ], |
| 86 | + "metadata.label.bk_biz_id.keyword": [ |
| 87 | + "<em>2</em>" |
| 88 | + ] |
| 89 | + }, |
| 90 | + "type": "object", |
| 91 | + "score": 2.2249658 |
| 92 | + } |
| 93 | + ] |
| 94 | + } |
| 95 | +} |
| 96 | +``` |
| 97 | +* output字段说明 |
| 98 | + |
| 99 | +| 名称 | 类型 | 说明 |Description| |
| 100 | +|---|---|---|---| |
| 101 | +| result | bool | 请求成功与否。true:请求成功;false请求失败 |request result| |
| 102 | +| bk_error_code | int | 错误编码。 0表示success,>0表示失败错误 |error code. 0 represent success, >0 represent failure code | |
| 103 | +| bk_error_msg | string | 请求失败返回的错误信息 |error message from failed request| |
| 104 | +| data | object | 请求返回的数据 |return data| |
| 105 | + |
| 106 | +data说明: |
| 107 | + |
| 108 | +| 名称 | 类型 | 说明 |Description| |
| 109 | +|---|---|---|---| |
| 110 | +| total | int | 总数 | 搜索匹配的总数 | |
| 111 | +| aggregations | object list | 数据汇聚 | 搜索的匹配结果分类统计 | |
| 112 | +| key | string | 模型id | 匹配结果的所属模型id | |
| 113 | +| count | int | 计数 | 匹配结果中所属此模型的数量 | |
| 114 | +| hits | object list | 匹配结果列表 | 搜索的匹配结果的集合 | |
| 115 | +| type | string | 类型 | 查询结果所属数据类型 | |
| 116 | +| score | float | 最佳匹配得分 | 搜索结果匹配程度 | |
| 117 | +| source | object | 属性值 | 搜索结果的具体内容 | |
| 118 | +| highlight| object| 高亮字段| 匹配高亮显示的字段 | |
0 commit comments