mwmitchell-rsolr-ext 0.7.0 → 0.7.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/README.rdoc CHANGED
@@ -47,14 +47,16 @@ The object returned is an RSolr::Connection::Adapter (Direct or HTTP) with addit
47
47
 
48
48
  The #find method provides a convenient way to search solr. Here are some examples:
49
49
 
50
+ solr = RSolr::Ext.connect
51
+
50
52
  # q=jefferson - returns all docs
51
- all_jefferson_docs = find 'jefferson'
53
+ all_jefferson_docs = solr.find 'jefferson'
52
54
 
53
55
  # q=jefferson&rows=1 -- first doc only
54
- a_single_jefferson_doc = find :first, 'jefferson'
56
+ a_single_jefferson_doc = solr.find :first, 'jefferson'
55
57
 
56
58
  # q=jefferson&fq=type:"book" - all docs
57
- books_about_jefferson = find 'jefferson', :phrase_filters=>{:type=>'book'}
59
+ books_about_jefferson = solr.find 'jefferson', :phrase_filters=>{:type=>'book'}
58
60
 
59
61
  # q=something -- the entire response
60
- solr_response = find {:q=>'something'}, :include_response=>true
62
+ solr_response = solr.find {:q=>'something'}, :include_response=>true
data/lib/rsolr-ext.rb CHANGED
@@ -23,7 +23,7 @@ module RSolr
23
23
 
24
24
  module Ext
25
25
 
26
- VERSION = '0.7.0'
26
+ VERSION = '0.7.1'
27
27
 
28
28
  autoload :Request, 'rsolr-ext/request.rb'
29
29
  autoload :Response, 'rsolr-ext/response.rb'
@@ -54,15 +54,16 @@ module RSolr::Ext::Findable
54
54
  response['response']['docs'][i] = yield(doc)
55
55
  end
56
56
  end
57
- if mode == :first
58
- # return only one doc
59
- response['response']['docs'].first
60
- elsif opts[:include_response] == false
61
- # return all docs
62
- response['response']['docs']
63
- else
64
- # return the entire response
57
+ if opts[:include_response] == true
65
58
  response
59
+ else
60
+ if mode == :first
61
+ # return only one doc
62
+ response['response']['docs'].first
63
+ else
64
+ # return all docs
65
+ response['response']['docs']
66
+ end
66
67
  end
67
68
  end
68
69
 
data/rsolr-ext.gemspec CHANGED
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = "rsolr-ext"
3
- s.version = "0.7.0"
3
+ s.version = "0.7.1"
4
4
  s.date = "2009-05-04"
5
5
  s.summary = "An extension lib for RSolr"
6
6
  s.email = "goodieboy@gmail.com"
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mwmitchell-rsolr-ext
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.0
4
+ version: 0.7.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Matt Mitchell