Added support for couchdb-lucene.
Added a search method to CouchRest:Database to search the documents in a given database. Added support for a :search parameter to Collection's paginated_each method, which will allow you to paginate over a set of search results. This code has been brought to you by Dave Farkas (sakrafd) and Arnaud Berthomier (oz).
This commit is contained in:
parent
13d76d38de
commit
b26f90d2ff
5 changed files with 115 additions and 9 deletions
|
@ -44,7 +44,14 @@ module CouchRest
|
|||
CouchRest.get url
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
# Query a CouchDB-Lucene search view
|
||||
def search(name, params={})
|
||||
# -> http://localhost:5984/yourdb/_fti/YourDesign/by_name?include_docs=true&q=plop*'
|
||||
url = CouchRest.paramify_url "#{root}/_fti/#{name}", params
|
||||
CouchRest.get url
|
||||
end
|
||||
|
||||
# load a set of documents by passing an array of ids
|
||||
def get_bulk(ids)
|
||||
documents(:keys => ids, :include_docs => true)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue