Page MenuHomePhabricator

Let users sort results by time (older or newer results)
Open, Needs TriagePublic

Description

Results are shown in random order (2018, 2015, 2017....). It would be nice if users could sort the results by date/time (at least by the timestamp for the most recent edit).

Use case: I want to search for a specific phrase related to my project to see if there is any discussion about it that I missed on the wiki.

The dates (highlighted in red) shown beneath the results are the timestamps of the last time the page was edited. Since my project was fairly recent, I am not interested in seeing results from 2015 or 2016. It'd be nice if we could have an option to sort the results by date time or something like filter results from the last 6 months/last 1 year etc.

Event Timeline

Niharika created this task.Jun 17 2018, 2:12 AM
Restricted Application added a project: TCB-Team. · View Herald TranscriptJun 17 2018, 2:12 AM
Restricted Application added a subscriber: Aklapper. · View Herald Transcript
Alsee added a subscriber: Alsee.Jun 18 2018, 5:36 AM

I've been considering requesting something like this myself, but I realize it may be difficult. I expect the primary use case is searching talk pages. I assume using the date of an edit itself is infeasible, but maybe catching standard signature timestamps could be viable?

It would be a major help even if just one date (the most recent timestamp) was used for the entire page. Most discussions pages cover a relatively constrained timespan. That would be enough to narrow down a search to recently active pages, or to specifically look back for pages archived some time ago.

The last-edited date for the page might be usable, although maintenance edits may unhelpfully reset the page as recent.

thiemowmde moved this task from Incoming to Advanced Search on the TCB-Team board.Jun 18 2018, 9:45 AM

It would be a major help even if just one date (the most recent timestamp) was used for the entire page. Most discussions pages cover a relatively constrained timespan. That would be enough to narrow down a search to recently active pages, or to specifically look back for pages archived some time ago.

That's what I was looking for. Like sometimes I'm searching for a recent feature that was introduced or a recent event that occurred and I'm only interested in active pages having that phrase.

Niharika updated the task description. (Show Details)Jun 18 2018, 10:10 PM

@Niharika and @Alsee thanks for the feedback! Do you maybe have a concrete example (including screenshot) what you were looking for and which of the entries you wished to be at which position? Just to make sure we understand everything correctly :)

Niharika updated the task description. (Show Details)Jun 25 2018, 8:22 PM

@Lea_WMDE I updated the description to add more information. Thanks! :)

Vvjjkkii renamed this task from Let users sort results by time (older or newer results) to isaaaaaaaa.Jul 1 2018, 1:03 AM
Vvjjkkii triaged this task as High priority.
Vvjjkkii updated the task description. (Show Details)
Vvjjkkii removed a subscriber: Aklapper.
CommunityTechBot raised the priority of this task from High to Needs Triage.
CommunityTechBot renamed this task from isaaaaaaaa to Let users sort results by time (older or newer results).
CommunityTechBot added a subscriber: Aklapper.
Alsee added a comment.EditedJul 8 2018, 4:22 PM

@Lea_WMDE I'll make up a typical example search I'd use. Here's a search for "short description" in namespace Wikipedia or Wikipedia talk.

The search results have a timestamp in green, which I assume is the last-edit date. The simplest thing would be to let me sort, or reverse-sort, by that date. Three use cases:

For the last year and a half, there have been many discussions relating to the Wikidata short description, and replacing it with a local description. If I'm trying to find a specific discussion on that topic, anything prior to 2017 is not relevant.

If there are any new discussions on the topic, ones I didn't know about, they'll be the first results. That's a great use case, I didn't even have that in mind originally.

On the other hand if I'm looking for some old discussion using "short description" in some completely different context, then all of those 2017/2018 hits are unwanted noise. I could either reverse the sort, or I could quick skip down to 2016-and-earlier.

This kind of search result would probably disregard any-and-all other sorting criteria.

I'll also cite a detail which would probably require black magic. I don't realistically expect you to deal with this. Skimming through those search results, one of the hits was Wikipedia:Articles_for_deletion/Log/2005_April_7. If you look at the history of that page, exactly 100% of the content is from 2005. However a bot made a maintenance edit in 2013‎, which was then reverted. Those edits are irrelevant noise. It would be most impressive if you found a way to sort that as 2005.

EBernhardson added a subscriber: EBernhardson.EditedAug 1 2018, 11:46 PM

FWIW we can provide results sorted by the last edit in the api, this is strictly the last edit. This was implemented at the hackathon in Barcelona. We could invent an addtional, perhaps last non-minor edit, timestamp. But i'm not certain that's going to cover other use cases.

For example: https://en.wikipedia.org/wiki/Special:ApiSandbox#action=query&format=json&list=search&srsearch=foobar&srsort=last_edit_desc

Extracting timestamps from the wikitext content (such as signatures) and then matching those dates would be a significant undertaking. I suppose we could get an 80% solution relatively quickly, but not having glaring edge cases will be significantly more work. This isn't necessarily a search specific task though, what needs to be done in some php code that takes in a ParserOutput (to fit the current internal api's, although wikitext is also doable) and emits a list of dates involved. The 80% solution is probably some regular expressions, and playing wack-a-mole with language formatting variations. From the standpoint of taking a list of dates into search and sorting or filtering by them, that part is mostly straight forward.

would adding a "prefer recent" option solve the issue?

Alsee added a comment.Aug 23 2018, 7:26 PM

Prefer Recent is interesting, but it's no help for key use cases. If I know a discussion happened in approximately May 2016 and there are thousands of search hits, I can't find it.

I just had another idea. I haven't deeply thought it through, but in many cases sorting by date of page creation would be quite effective in finding content from a specific time frame. The main use cases I have in mind tend to involve community process pages. Those pages are often either active for limited time span (i.e. Article For Deletion pages), or they archive on a regular basis (i.e. Village Pump and many Talk pages). In those cases the date of page creation is very closely bound to the date of the content I seek.

If we can add two options, I think "Prefer Recent" and "sort by page creation date" effectively covers the range of use cases.

would adding a "prefer recent" option solve the issue?

It's definitely a help but as @Alsee points out, there are still cases where it's not as good.

Aside, it'd be nice to have options like prefer-recent available under the search bar so people can find them.

Ainali added a subscriber: Ainali.Feb 6 2019, 10:59 AM

Note: This is now possible to do in normal searches via tweaking the search URL, per work on T40403. I've mentioned it in the docs.
It would be great to have (some? all?) of these Help:CirrusSearch#Explicit sort orders features added to the Advanced Search interface for easy access. Cheers!

Change 510934 had a related patch set uploaded (by Tonina Zhelyazkova; owner: Tonina Zhelyazkova):
[mediawiki/extensions/AdvancedSearch@master] Add Sorting order section to Advanced Search panel

https://gerrit.wikimedia.org/r/510934

Trizek-WMF added a subscriber: Trizek-WMF.

When will it be deployed? When ready, please move it to "Announce in next Tech News" on the User-notice board.

TheDJ awarded a token.May 19 2019, 5:03 PM