Class: Redis::Search::Config

Inherits:
Object
  • Object
show all
Defined in:
lib/redis-search/config.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeConfig

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_lengthObject

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

#debugObject

Debug toggle, default false



15
16
17
# File 'lib/redis-search/config.rb', line 15

def debug
  @debug
end

#pinyin_matchObject

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
  @pinyin_match
end

#redisObject

Redis



13
14
15
# File 'lib/redis-search/config.rb', line 13

def redis
  @redis
end