根据文档,我使用这种语法:
self.search(
query: {
bool: {
must: { match: { type: 'user' } },
must: { match: { status: status } },
must: { range: { created_at: { from: date_from, to: date_to } } }
}
},
size: 1000
)
我相信它应该寻找所有 3 个条件,但查询忽略了must
最后一个条件:
<Elasticsearch::Model::Searching::SearchRequest:0x000000039b2c08
@definition=
{:index=>"uusers",
:type=>"user",
:body=>{:query=>{:bool=>{:must=>{:range=>{:created_at=>{:from=>Mon, 25 Aug 2014, :to=>Thu, 18 May 2017}}}}}, :size=>1000}}
我究竟做错了什么?