使用以下查询来搜索名为“new java”或“java new”
的书籍"bool":{
"must":[
{
"term":{
"title":{
"value":"new"
}
}
},
{
"term":{
"title":{
"value":"java"
}
}
}
]
}
它正确地给出了值但显示重复记录也是我的意思是,它不应该返回以下内容,因为它有'new'和'java',它在不同的索引中但是这个结果也显示
{
"_index":"book-lists",
"_type":"book-list",
"_id":"AVBRSvHIXb7carZwcePS",
"_version":1,
"_score":1,
"_source":{
"title":"Technology",
"books":[
{
"title":"Java",
"isRead":true,
"summary":"lorem ipsum",
"rating":3.5
},
{
"title":"java jsp",
"isRead":true,
"summary":"lorem ipsum",
"rating":3.5
},
{
"title":"new servlet",
"isRead":true,
"summary":"lorem ipsum",
"rating":3.5
}
],
"numberViews":0,
"idOwner":"17xxxxxxxxxxxx45"
}
}
是否可以避免数组的不同索引中的匹配。