Time based indices are typically on a per model basis. If we detect a query that uses key specified in use_time_based_indices then we should automatically add the indexes to search_options.
.without_time_based_indices! should turn off this behavior on a per query basis.
class Post < Stretchy::Record
use_time_based_indices :created_at,
pattern: "posts_%Y_%m",
default: "posts_*",
context: [:query, :filter],
using: :time_based_indices
end
Time based indices are typically on a per model basis. If we detect a query that uses key specified in
use_time_based_indicesthen we should automatically add the indexes tosearch_options..without_time_based_indices!should turn off this behavior on a per query basis.use_time_based_indicesclass methodpatternto be specified and setindex_nameusing:a Proc or method to determine the required indicescontext:specify context to trigger time_based_indicesdefault:default index name (can be most recent index or index_name*, etc)search_options