Module: FullSearch::Model::InstanceMethods
- Defined in:
- lib/full_search/model.rb
Instance Attribute Summary collapse
-
#full_search_highlight_fields ⇒ Object
Returns the value of attribute full_search_highlight_fields.
-
#full_search_snippet ⇒ Object
Returns the value of attribute full_search_snippet.
Instance Method Summary collapse
- #full_search_text_for(field_name) ⇒ Object
-
#reindex_source_fields! ⇒ Object
Re-evaluates this record's source: fields and writes them to the FTS table immediately (synchronously).
Instance Attribute Details
#full_search_highlight_fields ⇒ Object
Returns the value of attribute full_search_highlight_fields.
82 83 84 |
# File 'lib/full_search/model.rb', line 82 def full_search_highlight_fields @full_search_highlight_fields end |
#full_search_snippet ⇒ Object
Returns the value of attribute full_search_snippet.
82 83 84 |
# File 'lib/full_search/model.rb', line 82 def full_search_snippet @full_search_snippet end |
Instance Method Details
#full_search_text_for(field_name) ⇒ Object
84 85 86 87 88 89 90 |
# File 'lib/full_search/model.rb', line 84 def full_search_text_for(field_name) dsl = self.class.full_search_dsl field = dsl.fields.find { |f| f.name == field_name.to_s || f.as == field_name.to_s } return nil unless field FullSearch::Model.evaluate_source(self, field) end |
#reindex_source_fields! ⇒ Object
Re-evaluates this record's source: fields and writes them to the FTS table immediately (synchronously). Use after a callback-free mutation (update_column, update_all, counter_cache/touch) to refresh the index.
95 96 97 |
# File 'lib/full_search/model.rb', line 95 def reindex_source_fields! FullSearch::Callbacks.reindex_record!(self) end |