mirror of https://github.com/apache/lucene.git
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:
parent
a5fc9fc90f
commit
afd4e0e962
|
@ -78,12 +78,29 @@ class Solr::Connection
|
||||||
# conn.query('borges') do |hit|
|
# conn.query('borges') do |hit|
|
||||||
# puts hit
|
# puts hit
|
||||||
# end
|
# 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)
|
def query(query, options={}, &action)
|
||||||
# TODO: Shouldn't this return an exception if the Solr status is not ok? (rather than true/false).
|
# 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)
|
create_and_send_query(Solr::Request::Standard, options.update(:query => query), &action)
|
||||||
end
|
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)
|
def search(query, options={}, &action)
|
||||||
create_and_send_query(Solr::Request::Dismax, options.update(:query => query), &action)
|
create_and_send_query(Solr::Request::Dismax, options.update(:query => query), &action)
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue