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
This commit is contained in:
Erik Hatcher 2008-02-13 11:07:51 +00:00
parent a5fc9fc90f
commit afd4e0e962
1 changed files with 17 additions and 0 deletions

View File

@ -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