def body(query, options)
      ret = { limit:  options[:limit]  || 10,
              offset: options[:offset] || 0 }

      if query && !query.empty?
        ret[:query] = [query].flatten.map do |q|
          q.tap { |iq| iq[:matchingMethod] ||= 'CONTAINS' }
        end

        ret[:sort] = sort_field(options, query)
      end

      ret
    end
def body(query, options)
      ret = { limit:  options[:limit]  || 10,
              offset: options[:offset] || 0 }

      if query && !query.empty?
        ret[:query] = [query].flatten.map do |q|
          q.tap { |iq| iq[:matchingMethod] ||= 'CONTAINS' }
        end

        ret[:sort] = sort_field(options, query)
      end

      ret
    end
Build a query body