-
Notifications
You must be signed in to change notification settings - Fork 53
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3679 from benwbrum/3644-search-attempt-tracking
WIP: Added search attempt tracking for #3644
- Loading branch information
Showing
49 changed files
with
787 additions
and
215 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
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 |
---|---|---|
@@ -0,0 +1,8 @@ | ||
// --------------------------- | ||
// SEARCH RESULTS | ||
// --------------------------- | ||
|
||
.search-heading { | ||
margin: 0; | ||
padding: 0 0 1em 0; | ||
} |
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
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
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
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
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
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 |
---|---|---|
@@ -0,0 +1,38 @@ | ||
module AdminExporter | ||
|
||
def admin_searches_csv(start_date, end_date) | ||
rows = [] | ||
header = ['Query', 'Date', 'Search Type', 'Collection Title', 'Collection ID', 'Work Title', 'Work ID', 'Hits', 'Clicks', 'Contributions', 'Visit ID', 'User ID', 'Owner'] | ||
|
||
start_date = start_date&.beginning_of_day || 1.week.ago.beginning_of_day | ||
end_date = end_date&.end_of_day || 1.day.ago.end_of_day | ||
searches = SearchAttempt.where('created_at BETWEEN ? AND ?', start_date, end_date).order(:created_at) | ||
searches.each do |search| | ||
row = [] | ||
row << search.query | ||
row << search.created_at | ||
row << search.search_type | ||
row << search.collection&.title || "" | ||
row << search.collection_id || "" | ||
row << search.work&.title || "" | ||
row << search.work&.id || "" | ||
row << search.hits | ||
row << search.clicks | ||
row << search.contributions | ||
row << search.visit_id | ||
row << search.user_id | ||
row << search.owner | ||
rows << row | ||
end | ||
|
||
csv_string = CSV.generate(headers: true) do |csv| | ||
csv << header | ||
rows.each do |row| | ||
csv << row | ||
end | ||
end | ||
|
||
csv_string | ||
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
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 |
---|---|---|
|
@@ -86,7 +86,4 @@ def owner_mailing_list_csv(owner) | |
csv_string | ||
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
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
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
Oops, something went wrong.