-
Notifications
You must be signed in to change notification settings - Fork 798
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Instant Search: Add instant search sorting based on the URL #13377
Conversation
…earch Everything seems to work.
…instant-search-sorting
OK, redid the merge. better now |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changes look reasonable and date sorting works as expected.
Not sure if we want to have ascending/descending sorts for results ordered by scores (recency, keyword, and popularity), so I left a comment inline below.
sort = 'rating_desc'; | ||
} | ||
break; | ||
case 'recency': |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we not want to have ascending/descending options for results ordered by recency, keyword, popularity, and relevance?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can really only do descending when you sort by any calculated score. Search engines are built to be fast to compute the top results only.
case 'recency': | ||
sort = 'score_recency'; | ||
break; | ||
case 'keyword': |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This orderby
returns a 400; message: "Invalid sort value: score_keyword"
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmmm, ya I guess i disabled that sort method because I wasn't sure if it made sense. Going to leave it in the code here for now. The idea behind it is to have a sorting that is only based on the term and document frequencies in the index.
Co-Authored-By: Jason Moon <4044428+jsnmoon@users.noreply.github.com>
* Implement minimal search results and spelling correction (#13365) * Add filtering display (#13371) * Fix search result display bugs and make improvements (#13393) * Add rudimentary support for filtering on post types (#13430) * Add support for filtering on categories and tags (#13505) * Add instant search sorting based on the URL (#13377) * Add support for filtering on dates (#13545) * Add custom taxonomy filtering (#13605) * add sort widget (#13614) * fix many theme incompatibilities (#13602) * Add infinite scrolling (#13684) * Add caching to the api requests (#13714) * Clean up some design bugs/issues (#13721) * Fix labels for post types when we have them. (#13750) * Add localization and formatting of all dates (#13748) * search from any page on the site (#13713) * Hook up default options (inc. sort) (#13742) * Add TrainTracks analytics (#13730) * Create PostTypeIcon component (#13790) * Upgrade to Preact 10 (#13794) * Add comments component (#13797) * Address review feedback
This PR merges onto the
instant-search-master
branch.This is implementing sorting based on the order and orderby params in the URL. We haven't implemented the dropdown yet.
An example url: http://gibrown.wpsandbox.me/main/?s=related&orderby=popularity&order=DESC&blog_id=20115252
And for that Jetpack.com blog_id the results look way better because it removes the recency weighting from http://gibrown.wpsandbox.me/main/?s=related&orderby=relevance&order=DESC&blog_id=20115252
This branch has been rebased on top of #13371 and assumes that will land first.