版本:7.17.2
Request
{
"field": "cn_name",
"text": "山崎 12"
}
Response
{
"tokens" : [
{
"token" : "山崎",
"start_offset" : 0,
"end_offset" : 2,
"type" : "CN_WORD",
"position" : 0
},
{
"token" : "12",
"start_offset" : 2,
"end_offset" : 4,
"type" : "ARABIC",
"position" : 1
}
]
}
Request
{
"profile": true,
"explain": true,
"query": {
"bool": {
"must": [
{
"match": {
"cn_name": {
"query": "山崎 12"
}
}
}
]
}
},
"from": 0,
"size": 10
}
Response
....
"_explanation" : {
"value" : 9.302625,
"description" : "sum of:",
"details" : [
{
"value" : 9.302625,
"description" : "weight(cn_name:12 in 13135) [PerFieldSimilarity], result of:",
"details" : [
{
"value" : 9.302625,
"description" : "score(freq=1.0), computed as boost * idf * tf from:",
只能命中数字 12
,山崎
不能命中,profile
的查询条件是有山崎
和 12
"profile" : {
"shards" : [
{
"id" : "[x-x][_tables][0]",
"searches" : [
{
"query" : [
{
"type" : "BooleanQuery",
"description" : "cn_name:山崎 cn_name:12",
Request
{
"profile": true,
"explain": true,
"query": {
"bool": {
"must": [
{
"match": {
"cn_name": {
"query": "山崎 12",
"operator": "and"
}
}
}
]
}
},
"from": 0,
"size": 10
}
添加了operator
参数做测试,但什么结果都匹配不到。搜索山崎 12 年
就能匹配到。想问下大佬我需要再做什么测试验证,从哪方便找问题呢?
这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。
V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。
V2EX is a community of developers, designers and creative people.