Class: Redis::Search::Config
- Inherits:
-
Object
- Object
- Redis::Search::Config
- Defined in:
- lib/redis/search/config.rb
Instance Attribute Summary collapse
-
#complete_max_length ⇒ Object
config for max length of content with Redis::Search.complete method,default 100 Please change this with your real data length, short is fast For example: You use complete search for your User model name field, and the “name” as max length in 15 chars, then you can set here to 15 warring! The long content will can’t be found, if the config length less than real content.
-
#debug ⇒ Object
Debug toggle, default false.
-
#disable_rmmseg ⇒ Object
Disable RMMSeg, if you don’t need, disable this will save memory.
-
#pinyin_match ⇒ Object
Pinyin search/index (true|false) - default = false If set this is true, the indexer will convert Chinese to Pinyin, and index them When you search “de” will -> 得|的|德…
-
#redis ⇒ Object
Redis.
Instance Method Summary collapse
-
#initialize ⇒ Config
constructor
A new instance of Config.
Constructor Details
#initialize ⇒ Config
Returns a new instance of Config.
36 37 38 39 40 41 42 |
# File 'lib/redis/search/config.rb', line 36 def initialize @debug = false @redis = nil @complete_max_length = 100 @pinyin_match = false @disable_rmmseg = false end |
Instance Attribute Details
#complete_max_length ⇒ Object
config for max length of content with Redis::Search.complete method,default 100 Please change this with your real data length, short is fast For example: You use complete search for your User model name field, and the “name” as max length in 15 chars, then you can set here to 15 warring! The long content will can’t be found, if the config length less than real content.
27 28 29 |
# File 'lib/redis/search/config.rb', line 27 def complete_max_length @complete_max_length end |
#debug ⇒ Object
Debug toggle, default false
22 23 24 |
# File 'lib/redis/search/config.rb', line 22 def debug @debug end |
#disable_rmmseg ⇒ Object
Disable RMMSeg, if you don’t need, disable this will save memory. (true|false) default = true
34 35 36 |
# File 'lib/redis/search/config.rb', line 34 def disable_rmmseg @disable_rmmseg end |
#pinyin_match ⇒ Object
Pinyin search/index (true|false) - default = false If set this is true, the indexer will convert Chinese to Pinyin, and index them When you search “de” will -> 得|的|德… When you search “得” will -> “de” -> 得|的|德…
32 33 34 |
# File 'lib/redis/search/config.rb', line 32 def @pinyin_match end |
#redis ⇒ Object
Redis
20 21 22 |
# File 'lib/redis/search/config.rb', line 20 def redis @redis end |