From afd4e0e9626caa41ee3eb01ad81131316ecb94e7 Mon Sep 17 00:00:00 2001 From: Erik Hatcher Date: Wed, 13 Feb 2008 11:07:51 +0000 Subject: [PATCH] SOLR-473: RDoc patch contributed Chris Kline git-svn-id: https://svn.apache.org/repos/asf/lucene/solr/trunk@627357 13f79535-47bb-0310-9956-ffa450edef68 --- client/ruby/solr-ruby/lib/solr/connection.rb | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/client/ruby/solr-ruby/lib/solr/connection.rb b/client/ruby/solr-ruby/lib/solr/connection.rb index b610dbc77ee..6e1aadcd1ea 100755 --- a/client/ruby/solr-ruby/lib/solr/connection.rb +++ b/client/ruby/solr-ruby/lib/solr/connection.rb @@ -78,12 +78,29 @@ class Solr::Connection # conn.query('borges') do |hit| # puts hit # end + # + # options include: + # + # :sort, :default_field, :rows, :filter_queries, :debug_query, + # :explain_other, :facets, :highlighting, :mlt, + # :operator => :or / :and + # :start => defaults to 0 + # :field_list => array, defaults to ["*", "score"] def query(query, options={}, &action) # TODO: Shouldn't this return an exception if the Solr status is not ok? (rather than true/false). create_and_send_query(Solr::Request::Standard, options.update(:query => query), &action) end + # performs a dismax search and returns a Solr::Response::Standard + # + # response = conn.search('borges') + # + # options are same as query, but also include: + # + # :tie_breaker, :query_fields, :minimum_match, :phrase_fields, + # :phrase_slop, :boost_query, :boost_functions + def search(query, options={}, &action) create_and_send_query(Solr::Request::Dismax, options.update(:query => query), &action) end