-
Notifications
You must be signed in to change notification settings - Fork 39
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
SRCH-1401 change sayt_suggestions default limit to 1000 (#570)
- Loading branch information
1 parent
09a4747
commit ab2aacb
Showing
2 changed files
with
9 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,19 @@ | ||
namespace :usasearch do | ||
namespace :sayt_suggestions do | ||
|
||
desc "generate top X SAYT suggestions from human Logstash searches for given YYYYMMDD date (defaults to an unlimited number for yesterday)" | ||
desc 'generate top X SAYT suggestions from human Logstash searches | ||
for given YYYYMMDD date (defaults to 1000 for yesterday)'.squish | ||
task :compute, [:day, :limit] => [:environment] do |t, args| | ||
args.with_defaults(:day => Date.yesterday.to_s(:number)) | ||
yyyymmdd = args.day.to_i | ||
limit = args.limit.nil? ? 0 : args.limit.to_i | ||
limit = args.limit.nil? ? 1000 : args.limit.to_i | ||
SaytSuggestion.populate_for(yyyymmdd, limit) | ||
end | ||
|
||
desc "expire SAYT suggestions that have not been updated in X days (defaults to 30)" | ||
desc 'expire SAYT suggestions that have not been updated in X days (defaults to 30)' | ||
task :expire, [:days_back] => [:environment] do |t, args| | ||
args.with_defaults(:days_back => 30) | ||
SaytSuggestion.expire(args.days_back.to_i) | ||
end | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters