| Module | ActsAsIndexed::ClassMethods |
| In: |
lib/acts_as_indexed/class_methods.rb
|
Declares a class as searchable.
| fields: | Names of fields to include in the index. Symbols pointing to instance methods of your model may also be given here. |
| index_file_depth: | Tuning value for the index partitioning. Larger values result in quicker searches, but slower indexing. Default is 3. |
| min_word_size: | Sets the minimum length for a word in a query. Words shorter than this value are ignored in searches unless preceded by the ’+’ operator. Default is 3. |
| index_file: | Sets the location for the index. By default this is RAILS_ROOT/tmp/index. Specify as an array. The default, for example, would be set as [Rails.root,’tmp’,’index]. |
Adds the passed record to the index. Index is built if it does not already exist. Clears the query cache.
Updates the index.
Finds instances matching the terms passed in query. Terms are ANDed by default. Returns an array of model instances or, if ids_only is true, an array of integer IDs.
Keeps a cache of matched IDs for the current session to speed up multiple identical searches.
Same as ActiveRecord#find options hash. An :order key will override the relevance ranking
| ids_only: | Method returns an array of integer IDs when set to true. |
| no_query_cache: | Turns off the query cache when set to true. Useful for testing. |