10

We could use the obvious syntax sortby:OPTION, where 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 OPTION when MYQUERY sortby:OPTION is entered into the search bar, just turn

https://meta.stackexchange.com/search?q=MYQUERY

into

https://meta.stackexchange.com/search?tab=votes&q=MYQUERY

where MYQUERY is just some place-holder text for an arbitrary query (so I'm not actually trying to search for the text MYQUERY).

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:

page:PAGENUMBER and pagesize:PAGESIZE

(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

page=PAGENUMBER& and pagesize=PAGESIZE&

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:

https://meta.stackexchange.com/search?page=TrAsH&tab=JunK&pagesize=GarBaGe&q=Please%20Improve%20Search

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:

https://meta.stackexchange.com/search?page=2&tab=votes&pagesize=30&q=Please%20Improve%20Search

(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.

  • 1
    @Rob I know that I can build the URL by clicking on the appropriate tab/page number but the point is that I don't want to have to click on this element in order for the corresponding code to appear within the URL. For instance, if I know that I want my search results to be sorted by votes then currently I have to (1) search for my query using the search box, and then (2) have to click on the "Votes" tab to sort it by votes. What I want is to have (2) be done automatically whenever sortby:votes appears as part of the search query (so I don't have to click on the "Votes" tab). – mgkrupa Dec 4 at 19:29

You must log in to answer this question.

Browse other questions tagged .