Module: RediSearch::Model::ClassMethods
- Defined in:
- lib/redi_search/model.rb
Instance Attribute Summary collapse
-
#search_index ⇒ Object
readonly
Returns the value of attribute search_index.
Instance Method Summary collapse
-
#redi_search(**options, &schema) ⇒ Object
rubocop:disable Metrics/MethodLength.
Instance Attribute Details
#search_index ⇒ Object (readonly)
Returns the value of attribute search_index.
10 11 12 |
# File 'lib/redi_search/model.rb', line 10 def search_index @search_index end |
Instance Method Details
#redi_search(**options, &schema) ⇒ Object
rubocop:disable Metrics/MethodLength
13 14 15 16 17 18 19 20 21 22 23 24 25 |
# File 'lib/redi_search/model.rb', line 13 def redi_search(**, &schema) @search_index = Index.new( [[:index_prefix], model_name.plural, RediSearch.env]. compact.join("_"), self, &schema ) register_search_commit_hooks scope :search_import, -> { all } unless defined?(search_import) include InstanceMethods extend ModelClassMethods end |