429
430
431
432
433
434
435
436
437
438
|
# File 'lib/tire/index.rb', line 429
def register_percolator_query(name, options={}, &block)
options[:query] = Search::Query.new(&block).to_hash if block_given?
@response = Configuration.client.put "#{Configuration.url}/_percolator/#{@name}/#{name}", MultiJson.encode(options)
MultiJson.decode(@response.body)['ok']
ensure
curl = %Q|curl -X PUT "#{Configuration.url}/_percolator/#{@name}/#{name}?pretty" -d '#{MultiJson.encode(options, :pretty => Configuration.pretty)}'|
logged('_percolator', curl)
end
|