我在 ElasticSearch 中有以下映射:
{
"xenforo" : {
"post" : {
"_source" : {
"enabled" : false
},
"properties" : {
"date" : {
"type" : "long",
"store" : "yes"
},
"discussion_id" : {
"type" : "long",
"store" : "yes"
},
"message" : {
"type" : "string"
},
"node" : {
"type" : "long"
},
"thread" : {
"type" : "long"
},
"title" : {
"type" : "string"
},
"user" : {
"type" : "long",
"store" : "yes"
}
}
},
我想在消息字段中搜索单词 test 但将其限制为节点 id 5。我将如何修改此 DSL 搜索?
$data_string = '{
"from" : 0, "size" : 100,
"sort" : [
{ "date" : {"order" : "desc"} }
],
"query": {
"match" : {
"message" : {
"query" : "test"
}
}
}
}';
感谢您的协助。