redis-search 0.9.4 → 0.9.5

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: bb565b1c1ccee90af57c7baa1c704927f67c2e69
4
- data.tar.gz: 78bf5f15c446c18eba87b1f1d6f8f9284e4345d1
3
+ metadata.gz: 60fec212ee4e4748c4133d4e0c4b9aff8ef79f08
4
+ data.tar.gz: 835d412d57bcea35bd328d5a988667e34d4e79fb
5
5
  SHA512:
6
- metadata.gz: 7adbd0b4309fcede9510a07c36fbb34cb34fe70deb4ce90bb5f9eef918255fe50b4d30aa5095b4c84eb19cd98b97bb905f4bb2d76ada2d047fc3b662ce92e0fb
7
- data.tar.gz: 4181f0b5924db8f1062cbdc9065e41c8b1f70f4f9a7be8c5d92d7e0cadd22f210a804991dc67973a2b4555b09ec8f1c2ac7e0cc9b50508d4c91b537de235ecd5
6
+ metadata.gz: 01a0c60c0594feb93a1ede4d305790ba28191d8f2319a1483f5f9ba83264404f11167c429c80e2dbdbd7356a33c1603ced9b345a511795080a32016b03c57055
7
+ data.tar.gz: ae3a0a94241cdfd30a4448625c7a8efbb698c152c913701caeacf8b21dd26522a542da3b6fa9dbf3955d1dbe85523f0736b157fa384a5a20a9beb77e895dec6b
data/README.md CHANGED
@@ -70,7 +70,7 @@ And there is an [Example App](https://github.com/huacnlee/redis-search-example)
70
70
 
71
71
  ## Usage
72
72
 
73
- * Bind Redis::Search callback event, it will to rebuild search indexes when data create or update.
73
+ * Bind Redis::Search callback event, it will to rebuild search indices when data create or update.
74
74
 
75
75
  ```ruby
76
76
  class Post
@@ -130,7 +130,7 @@ And there is an [Example App](https://github.com/huacnlee/redis-search-example)
130
130
 
131
131
  ## Index data to Redis
132
132
 
133
- If you are first install it in you old project, or your Redis cache lose, you can use this command to rebuild indexes.
133
+ If you are first install it in you old project, or your Redis cache lose, you can use this command to rebuild indices.
134
134
 
135
135
  ```bash
136
136
  $ rake redis_search:index
@@ -45,7 +45,7 @@ class Redis
45
45
 
46
46
  def redis_search_alias_value(field)
47
47
  return [] if field.blank? or field == "_was"
48
- val = instance_eval("self.\#{field}").clone
48
+ val = (instance_eval("self.\#{field}") || "").clone
49
49
  return [] if !val.class.in?([String,Array])
50
50
  if val.is_a?(String)
51
51
  val = val.to_s.split(",")
@@ -51,10 +51,11 @@ class Redis
51
51
  def self.remove(options = {})
52
52
  type = options[:type]
53
53
  Redis::Search.config.redis.hdel(type,options[:id])
54
+ Redis::Search.config.redis.del(Search.mk_score_key(type,options[:id]))
55
+
54
56
  words = Search::Index.split_words_for_index(options[:title])
55
57
  words.each do |word|
56
58
  Redis::Search.config.redis.srem(Search.mk_sets_key(type,word), options[:id])
57
- Redis::Search.config.redis.del(Search.mk_score_key(type,options[:id]))
58
59
  end
59
60
 
60
61
  # remove set for prefix index key
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: redis-search
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.4
4
+ version: 0.9.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jason Lee
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-02-11 00:00:00.000000000 Z
11
+ date: 2014-02-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: ruby-pinyin