将filter_path添加到ElasticSearch查询时出错:错误[bool]格式错误的查询,预期[END_OBJECT]但找到[FIELD_NAME]

时间:2018-04-03 07:32:28

标签: elasticsearch

  

我有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

0 个答案:

没有答案