redis-search 0.3 → 0.3.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.
Files changed (2) hide show
  1. data/lib/redis_search/search.rb +4 -5
  2. metadata +6 -6
@@ -58,13 +58,13 @@ module RedisSearch
58
58
 
59
59
  # 建立前最索引
60
60
  if prefix_index_enable
61
- save_prefix_index(self.title)
61
+ save_prefix_index
62
62
  end
63
63
  end
64
64
 
65
- def save_prefix_index(title)
66
- return if not Search.word?(title)
67
- word = title.downcase
65
+ def save_prefix_index
66
+ word = self.title.downcase
67
+ RedisSearch.config.redis.sadd(Search.mk_sets_key(self.type,self.title), self.id)
68
68
  key = Search.mk_complete_key(self.type)
69
69
  (1..(word.length)).each do |l|
70
70
  prefix = word[0...l]
@@ -74,7 +74,6 @@ module RedisSearch
74
74
  end
75
75
 
76
76
  def self.remove(options = {})
77
- puts options.inspect
78
77
  type = options[:type]
79
78
  RedisSearch.config.redis.hdel(type,options[:id])
80
79
  words = Search.split(options[:title])
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: redis-search
3
3
  version: !ruby/object:Gem::Version
4
- version: '0.3'
4
+ version: 0.3.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,11 +9,11 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2011-08-17 00:00:00.000000000Z
12
+ date: 2011-08-18 00:00:00.000000000Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rmmseg-cpp-huacnlee
16
- requirement: &2159797520 !ruby/object:Gem::Requirement
16
+ requirement: &2159787780 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ~>
@@ -21,10 +21,10 @@ dependencies:
21
21
  version: 0.2.8
22
22
  type: :runtime
23
23
  prerelease: false
24
- version_requirements: *2159797520
24
+ version_requirements: *2159787780
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: redis
27
- requirement: &2159797040 !ruby/object:Gem::Requirement
27
+ requirement: &2159787300 !ruby/object:Gem::Requirement
28
28
  none: false
29
29
  requirements:
30
30
  - - ~>
@@ -32,7 +32,7 @@ dependencies:
32
32
  version: 2.1.1
33
33
  type: :runtime
34
34
  prerelease: false
35
- version_requirements: *2159797040
35
+ version_requirements: *2159787300
36
36
  description: High performance real-time search (Support Chinese), index in Redis for
37
37
  Rails application.
38
38
  email: