input{
elasticsearch{
hosts=>["localhost"]
index=>"sample_index"
query=>'{"query":{"match_all":{}}}'
scroll=>"5m"
docinfo=>true
}
}filter{
elasticsearch{
hosts=>["localhost"]
index=>"sample_index"
query=>"NOT(city:delhi)"
sort=>"code:asc"
result_size=>5
fields=>{
"code"=>"Code"
"name"=>"Name"
"city"=>"City"
"salary"=>"Salary"
}
}
}
output{
elasticsearch{
hosts=>["localhost"]
index=>"filter_sample_index4"
}
}
我就是这样做的。有人知道我哪里做错了吗
我有记录吗 { "sample_index":{ "name":"ABC", "salary":56000, "city":"mumbai" }, { "name":"XYZ", "salary":54400, "city":"DEHI" }, { "name":"QWERTY", "salary":65000, "city":"Delhi" }, { "name":"JACK", "salary":26000, "city":"mumbai" } }
我想要的是基于城市过滤掉索引{“filter\u index”:{“name”:“”,“salary”:56000,“city”:“mumbai”}, {“姓名”:“杰克”,“薪水”:26000,“城市”:“孟买”} }
1条答案
按热度按时间kuhbmx9i1#
自从
query
参数使用query_string
查询语法,您可以简单地反转查询,如下所示: