我们minimal_english
在映射中使用了词干过滤器。这是为了确保只有单数和复数是可搜索的,而不是相似的词。例如。Test
并且在输入术语时Tests
应该是可搜索的Test
- 但Tester
, Testers
,Testing
不应该是. 在尝试使用以下 RESTful API 进行搜索时,multi_field
属性类型是可搜索的,但nested
属性类型是不可搜索的:
curl -X GET "http://10.113.124.136:9400/libtester/_search?pretty=true" -d '{
"query": {
"query_string": {
"query": " DescriptionDescription ",
"fields": [
"abc"
]
}
}
}'
映射如下所示:
{
"properties": {
"abc": {
"type": "multi_field",
"fields": {
"c_asset_id": {
"type": "string",
"index": "analyzed",
"include_in_all": true,
"analyzer": "basic_english"
},
"untouched": {
"type": "string",
"index": "analyzed",
"include_in_all": false,
"analyzer": "string_lowercase"
}
}
},
"xyz": {
"type": "nested",
"properties": {
"c_viewpoint": {
"type": "multi_field",
"fields": {
"c_viewpoint": {
"type": "string",
"index": "analyzed",
"include_in_all": true,
"analyzer": "basic_english"
},
"untouched": {
"type": "string",
"index": "analyzed",
"include_in_all": false,
"analyzer": "string_lowercase"
}
}
}
}
},
...
}
}
这是否与嵌套类型的映射有关 - xyz,它们不能从与 multi_field 类型相同的 API 中搜索?