Revision 13812
Added by Jean-Philippe Lang over 10 years ago
trunk/lib/plugins/acts_as_searchable/lib/acts_as_searchable.rb | ||
---|---|---|
64 | 64 |
# Searches the model for the given tokens and user visibility. |
65 | 65 |
# The projects argument can be either nil (will search all projects), a project or an array of projects. |
66 | 66 |
# Returns an array that contains the rank and id of all results. |
67 |
# In current implementation, the rank is the record timestamp. |
|
67 |
# In current implementation, the rank is the record timestamp converted as an integer.
|
|
68 | 68 |
# |
69 | 69 |
# Valid options: |
70 | 70 |
# * :titles_only - searches tokens in the first searchable column only |
... | ... | |
73 | 73 |
# |
74 | 74 |
# Example: |
75 | 75 |
# Issue.search_result_ranks_and_ids("foo") |
76 |
# # => [[Tue, 26 Jun 2007 22:16:00 UTC +00:00, 69], [Mon, 08 Oct 2007 14:31:00 UTC +00:00, 123]]
|
|
76 |
# # => [[1419595329, 69], [1419595622, 123]]
|
|
77 | 77 |
def search_result_ranks_and_ids(tokens, user=User.current, projects=nil, options={}) |
78 | 78 |
if projects.is_a?(Array) && projects.empty? |
79 | 79 |
# no results |
Also available in: Unified diff
Updates comments for r13811.