[#15] [Backend] As a user, I can query keywords, [#16] [UI] As a user, I can query keywords, #45
[#15] [Backend] As a user, I can query keywords, [#16] [UI] As a user, I can query keywords, #45mosharaf13 wants to merge 2 commits into
Conversation
| search_keyword = params[:search_keyword] | ||
|
|
||
| if search_keyword.present? | ||
| @pagy, @search_stats = pagy(current_user.search_stats.where(keyword: search_keyword)) |
There was a problem hiding this comment.
| Calls 'current_user.search_stats' 2 times |
| if search_keyword.present? | ||
| @pagy, @search_stats = pagy(current_user.search_stats.where(keyword: search_keyword)) | ||
| else | ||
| @pagy, @search_stats = pagy(current_user.search_stats) |
There was a problem hiding this comment.
| Calls 'current_user.search_stats' 2 times |
|
Code coverage is now at 0.00% (0/93 lines) Generated by 🚫 Danger |
There was a problem hiding this comment.
The query condition in this PR is too simple. Pls check the requirement
At least, the following examples must be implemented
Allow users to query all the stored data across all their uploaded keyword.
Examples of the SQL queries which users can run:
- How many URLs contain the word
technologyin AdWords.- How many times a specific URL shows up in stored search results.
- How many keywords have URLs in stored search results with 2 or more
/or 1 or more>.
| @pagy, @search_stats = pagy(current_user.search_stats) | ||
| search_keyword = params[:search_keyword] | ||
|
|
||
| if search_keyword.present? |
There was a problem hiding this comment.
You should consider using Queries to organize the code to support complex queries
https://nimblehq.co/compass/development/code-conventions/ruby/ruby-on-rails/#convention-45
example https://github.com/nimblehq/mia-web/tree/development/engines/mia_campaign/app/queries/mia_campaign
Closes #15
Closes #16
What happened 👀
Insight 📝
Proof Of Work 📹
Before search
After search