We could use the obvious syntax
OPTION is one of:
Relevance Newest Votes Active
All it would take to implement this would be to insert
tab=OPTION& after the question mark and before the
q=MYQUERY in the URL that is generated when searching for
MYQUERY. Example: to automatically sort by
MYQUERY sortby:OPTION is entered into the search bar, just turn
MYQUERY is just some place-holder text for an arbitrary query (so I'm not actually trying to search for the text
For example, lets say that I want to search for the word
works and I know even before searching that I want the results to be sorted by votes. Currently, in order to do this I have to search for
works by using the search box (which leads me to the page https://meta.stackexchange.com/search?q=works) and then I have to click on the "Votes" tab (which leads me to the page https://meta.stackexchange.com/search?tab=votes&q=works). What I'm envisioning is that whenever the text
sortby:votes appears within the search query (e.g. if I search for
works sortby:votes) then I am automatically led to the page https://meta.stackexchange.com/search?tab=votes&q=works (in contrast, currently a search for
works sortby:votes leads to the page https://meta.stackexchange.com/search?q=works+sortby%3Avote).
Heck, adding these two other options:
(both of which are also missing and would be appreciated) would be even easier since you literally just change the
: into an
=, add an
& to the end, and then insert the resulting
after the question mark.
Of course, ideally
PAGENUMBER is a valid page number that it automatically loads on and
PAGESIZE is one of 10, 30, or 50, but what if it isn't? What if someone enters into the search box
Please Improve Search page:TrAsH sortby:JunK pagesize:GarBaGe
Will anything break? NO! Just click the theoretical resulting link yourself:
Any invalid input is ALREADY automatically ignored and set to its default.
On the other hand, for some valid search query, such as:
Please Improve Search page:2 sortby:votes pagesize:30
everything would work exactly as expected since the resulting link would be:
(note that it worked even though
votes began with a lower case 'v' rather than an upper case 'V').
This is a little thing that would improve Stack Exchange, especially when using the search feature to find out whether or not your question has already been asked or answered. In particular, it would help by making it easier to wade through the sometimes hundreds or thousands of search results that are returned by making it faster and easier to repeatedly change or refine your query without having to find your old location in the search results over and over again.