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 +4 -4
- data/README.md +2 -2
- data/lib/redis/search/base.rb +1 -1
- data/lib/redis/search/index.rb +2 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 60fec212ee4e4748c4133d4e0c4b9aff8ef79f08
|
4
|
+
data.tar.gz: 835d412d57bcea35bd328d5a988667e34d4e79fb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
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
|
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
|
data/lib/redis/search/base.rb
CHANGED
@@ -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(",")
|
data/lib/redis/search/index.rb
CHANGED
@@ -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
|
+
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
|
+
date: 2014-02-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: ruby-pinyin
|