我有Elasticsearch查询功能,将错误视为格式错误的查询。当我在查询生成器中添加filter_path键时,它会抛出错误请参阅我的查询:
def query(options = {})
aggregations = {}
buckets = {}
buckets_for_unique_users buckets, aggregations
filters = []
filters << time_filter(options)
query = {
query: { bool: { filter: filters }, filter_path: ['unique_users,unique_users.user_details.hits.hits._id'] },
aggregations: buckets
}
query
end
更新:
以下是搜索查询功能
def user
@builder = ::Order::Report::UserBuilder.new @frequency, @offset, @periods
query = @builder.query restaurant_id: @restaurant_id, channel_id: @channel_id
@response = Payments::Order.__elasticsearch__.search query
end