如果我使用 searchkick 对 elasticsearch-rails 进行高级搜索,如下所示:
products = Activity.search body: {query: {bool: {must: [{ range: { min_age: {lte: 5} } }, { range: { max_age: {gte: 3} } } ] } } }, where: { category: "Programs", start_time: '2015-07-22' }
... where 子句没有被应用。这是可以预料的吗?我必须使用 body 来完成我的所有查询吗?有没有办法在 searchkick 中解决这个问题?
慢日志输出:
[2015-07-29 21:03:53,369][INFO ][index.search.slowlog.query] [ES Dev] [activities_development_20150729165655530][2] took[21.1ms], took_millis[21], types[], stats[], search_type[QUERY_THEN_FETCH], total_shards[5], source[{"query":{"bool":{"must":[{"range":{"min_age":{"lte":5}}},{"range":{"max_age":{"gte":3}}}]}}}], extra_source[],