Skip to content

Instantly share code, notes, and snippets.

@johanhalse
Created August 27, 2013 09:01
Show Gist options
  • Save johanhalse/6351304 to your computer and use it in GitHub Desktop.
Save johanhalse/6351304 to your computer and use it in GitHub Desktop.
Working searchkick query from rails console
2.0.0 :001 > Article.search 'om'
=> #<Searchkick::Results:0x00000006cf3a68 @response={"took"=>68, "timed_out"=>false,
"_shards"=>{"total"=>5, "successful"=>5, "failed"=>0}, "hits"=>{"total"=>4,
"max_score"=>0.035879318, "hits"=>[{"_index"=>"articles_development_20130827084418630",
"_type"=>"article", "_id"=>"1", "_score"=>0.035879318},
{"_index"=>"articles_development_20130827084418630", "_type"=>"article", "_id"=>"2",
"_score"=>0.032162987}, {"_index"=>"articles_development_20130827084418630",
"_type"=>"article", "_id"=>"3", "_score"=>0.026802491},
{"_index"=>"articles_development_20130827084418630", "_type"=>"article", "_id"=>"4",
"_score"=>0.020341659}]}}, @options={:load=>true, :payload=>{:query=>{:dis_max=>{
:queries=>[{:multi_match=>{:fields=>["_all"], :query=>"om", :use_dis_max=>false,
:operator=>"and", :boost=>10, :analyzer=>"searchkick_search"}},
{:multi_match=>{:fields=>["_all"], :query=>"om", :use_dis_max=>false, :operator=>"and",
:boost=>10, :analyzer=>"searchkick_search2"}}, {:multi_match=>{:fields=>["_all"],
:query=>"om", :use_dis_max=>false, :operator=>"and", :fuzziness=>1, :max_expansions=>3,
:analyzer=>"searchkick_search"}}, {:multi_match=>{:fields=>["_all"], :query=>"om",
:use_dis_max=>false, :operator=>"and", :fuzziness=>1, :max_expansions=>3,
:analyzer=>"searchkick_search2"}}]}}, :size=>100000, :from=>0, :fields=>[]},
:size=>100000, :from=>0, :term=>"om"}, @time=68, @total=4, @facets=nil,
@max_score=0.035879318, @wrapper=Tire::Results::Item>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment