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.



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_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.



27
28
29
# File 'lib/redis/search/config.rb', line 27

def complete_max_length
  @complete_max_length
end

#debugObject

Debug toggle, default false



22
23
24
# File 'lib/redis/search/config.rb', line 22

def debug
  @debug
end

#disable_rmmsegObject

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_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” -> 得|的|德…



32
33
34
# File 'lib/redis/search/config.rb', line 32

def pinyin_match
  @pinyin_match
end

#redisObject

Redis



20
21
22
# File 'lib/redis/search/config.rb', line 20

def redis
  @redis
end