activesearch 0.0.15 → 0.0.16

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.
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- NGUxNThlNTAxNjhmY2YxNDU1NTdhNjA3OTBkMjExMWE2YzI1NjVhZQ==
4
+ ZDRmYzczZTA2MjhjZGQ5NGYzOWVmOTdhOGI4NTg5YjkzZmVjNWI0MQ==
5
5
  data.tar.gz: !binary |-
6
- MjRlM2NkNGU2MDRhODhiNmM2MmQ5NTkwNzY5YTRiZjIwZTNmY2QyZg==
6
+ MzAwZTIxNDE5MmFlNTZlOTQxYWI0YTEwM2U0MGZlMDU5YzllYWIyMw==
7
7
  !binary "U0hBNTEy":
8
8
  metadata.gz: !binary |-
9
- NWU2MzI4ZTQ4NTU0MjE0OTA1NGE4ZDY3NDE4OTViYmZkNjhhNmEyZTlhYWUy
10
- NDJkYjczMmUxNmU4MzlkYjdjNzFmYTZmZjY0YmRjMWZjYjc4NTc5YzBiZjU0
11
- ZDgyZWZiNGExYWU2YmMzMTFmZTE0YzgyODQ3NjQwZDFhMGZkOTA=
9
+ NTRhMzQxMzU5ZmQ2NTkzOTI2NTE4M2I4NDAyMDJlY2VhODg1YjNjZDFiMGIy
10
+ YjFiYmM4N2U4MDIyNTllOGZkZDczYjA0YmU3MGEzZTQxZDBmNTMwOTM4Zjk2
11
+ OTg1YmNlNTQyYzdjZTkyNDg0NWZhYjgxZjMxNjdhODk4ZTJkNzQ=
12
12
  data.tar.gz: !binary |-
13
- YjQ2NDZlZmJjZDViYmNlZDI1ZDgyOTJiOWRlMGNlODI5ZDQ1YjQ3YzFjOWI5
14
- YmRkNDg5ZTJlM2YzNmMyMjVlN2VlOTFiYjYwMWM1MTNjNjQ4MDBhOTVjYzFj
15
- Y2JlYjI3N2M3YWY5YjRiN2VhNzg0NGZhODFhMDZmMzc0YWY4Yjg=
13
+ YzQ0YTQyNGQwY2VjMTg1ZDAyYjg3ZjJhYTJjZDQzZWM0ZWRiZTRkMWM5M2Zi
14
+ M2Q3Mjc3NTNjOWFiMzIzYTM2M2ZhODllYjliMTJkYzVhNGJlMGM2ODEyMTY5
15
+ YzdlN2IzYmU4ZmFhODZlNjk1MDNkNDQ1YjQxMTUxZDVkYTM1YTg=
@@ -6,7 +6,7 @@ module ActiveSearch
6
6
 
7
7
  def self.search(text, conditions = {})
8
8
  Proxy.new(text, conditions) do |text, conditions|
9
- text = text.split(/\s+/)
9
+ text = text.downcase.split(/\s+/)
10
10
  conditions.keys.each { |k| conditions["_stored.#{k}"] = conditions.delete(k) }
11
11
  conditions.merge!(:_keywords.in => text + text.map { |word| "#{I18n.locale}:#{word}"})
12
12
  Mongoid::Model.where(conditions)
@@ -1,3 +1,3 @@
1
1
  module ActiveSearch
2
- VERSION = "0.0.15"
2
+ VERSION = "0.0.16"
3
3
  end
data/spec/engines_spec.rb CHANGED
@@ -53,6 +53,10 @@ Dir[File.join(File.dirname(__FILE__), 'models', '*.rb')].map { |f| File.basename
53
53
  ActiveSearch.search("some text").first.to_hash["title"].should == "Some title"
54
54
  ActiveSearch.search("junk").first.to_hash["title"].should == "Junk"
55
55
  end
56
+
57
+ it "should find docs even with upcase searches" do
58
+ ActiveSearch.search("FINDABLE").count.should == 4
59
+ end
56
60
 
57
61
  it "should remove destroyed documents from index" do
58
62
  @findable.destroy
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: activesearch
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.15
4
+ version: 0.0.16
5
5
  platform: ruby
6
6
  authors:
7
7
  - Rodrigo Alvarez
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-04-23 00:00:00.000000000 Z
11
+ date: 2013-05-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -201,3 +201,4 @@ test_files:
201
201
  - spec/models/mongoid.rb
202
202
  - spec/mongoid_spec.rb
203
203
  - spec/spec_helper.rb
204
+ has_rdoc: