寻找
[
,只要确保用
\
创建查询时。给一个集合
title
字段定义为
string
有三份文件:
{
"id":"doc1",
"title":"This is a title",
"_version_":1602438086510247936
},
{
"id":"doc2",
"title":"[This is a title",
"_version_":1602438093178142720
},
{
"id":"doc3",
"title":"This is [a title",
"_version_":1602438101227012096
}
查询
title:[*
给予
doc2
作为一个打击:
{"numFound":1,"start":0,"docs":[{
"id":"doc2",
"title":"[This is a title",
"_version_":1602438093178142720}]}
两边通配符都能像你所期望的那样工作(
title:*\[*
):
"response":{"numFound":2,"start":0,"docs":[
{
"id":"doc2",
"title":"[This is a title",
"_version_":1602438093178142720},
{
"id":"doc3",
"title":"This is [a title",
"_version_":1602438101227012096}]
}}