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.
-
#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.
27 28 29 30 31 32 |
# File 'lib/redis-search/config.rb', line 27 def initialize @debug = false @redis = nil @complete_max_length = 100 @pinyin_match = 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.
20 21 22 |
# File 'lib/redis-search/config.rb', line 20 def complete_max_length @complete_max_length end |
#debug ⇒ Object
Debug toggle, default false
15 16 17 |
# File 'lib/redis-search/config.rb', line 15 def debug @debug 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” -> 得|的|德…
25 26 27 |
# File 'lib/redis-search/config.rb', line 25 def @pinyin_match end |
#redis ⇒ Object
Redis
13 14 15 |
# File 'lib/redis-search/config.rb', line 13 def redis @redis end |