Module: Redmine::Search

Defined in:
lib/redmine/search.rb

Defined Under Namespace

Modules: Controller Classes: Fetcher, Tokenizer

Constant Summary collapse

@@available_search_types =
[]

Class Method Summary collapse

Class Method Details

.cache_storeObject

Returns the cache store for search results Can be configured with config.redmine_search_cache_store= in config/application.rb



38
39
40
41
42
43
44
45
46
# File 'lib/redmine/search.rb', line 38

def cache_store
  @@cache_store ||= begin
    # if config.search_cache_store was not previously set, a no method error would be raised
    config = Rails.application.config.redmine_search_cache_store rescue :memory_store
    if config
      ActiveSupport::Cache.lookup_store config
    end
  end
end

.map {|_self| ... } ⇒ Object

Yields:

  • (_self)

Yield Parameters:



26
27
28
# File 'lib/redmine/search.rb', line 26

def map(&)
  yield self
end

.register(search_type, options = {}) ⇒ Object

Registers a search provider



31
32
33
34
# File 'lib/redmine/search.rb', line 31

def register(search_type, options={})
  search_type = search_type.to_s
  @@available_search_types << search_type unless @@available_search_types.include?(search_type)
end