Page MenuHomePhabricator

Rewrite Global Search (globalsearch) in JavaScript
Closed, DeclinedPublic

Description

The Global Search tool is written in PHP. Because of this it has to execute every search synchronously (i.e. one search, then the next, the the next...).

It should be rewritten in JavaScript so the searches can be performed asynchronously (i.e. in parallel). Also, we can display the progress to the user as the search is taking place.

Event Timeline

It might also be possible to do asynchronous searches via Guzzle (which is PHP). That might be easier than rewriting from scratch in JS.

Strictly speaking, we can parallelize much easier by porting a small part of it to Hack.

Strictly speaking, we can parallelize much easier by porting a small part of it to Hack.

It is possible to run HHVM on the Job Grid. See https://wikitech.wikimedia.org/wiki/Help:Tool_Labs/Web#HHVM_.28experimental.29 for the currently experimental process.


You might reach out on the labs-l mailing list to see if anyone has a good template for single page pure javascript apps that interact with the MediaWiki API. I wouldn't be surprised to find out that @Magnus, @Jdlrobson, or someone else has a base app you could copy. I think that most of what the current PHP scripts are doing is constructing a list of API calls and then formatting the results. This seems like the sort of thing that should be fairly easy to do 100% client side since there is no OAuth or other authentication involved.

I'd like to point out that these tools don't really get a lot of use and it might not be worth putting in too much effort into them.

I wouldn't put it super high on the CommTech priority list, but a good tool that can search across all wikis in a relatively performant way would probably get a fair amount of use if anyone knew it existed. Maybe this could be advertised as something for an interested volunteer to work on.

Yep. This would make for a good GSoC/Outreachy project.

Whoa... wasn't expecting any replies. :) When I was getting it up on tools labs I was thinking "This really needs to be refactored", but after removing OAuth in T166400 it became apparent that this doesn't even need to be a server-side application.

My preference would be that this would become a client-side application, I suppose my second preference would be to use curl's parallelizing (viz Guzzle Async), but the application still needs to be refactored. :)

Whoa... wasn't expecting any replies. :) When I was getting it up on tools labs I was thinking "This really needs to be refactored", but after removing OAuth in T166400 it became apparent that this doesn't even need to be a server-side application.

Welcome to mediawiki :) You'll find a lot of code that "really needs to be refactored" :)

MusikAnimal moved this task from Engineering Backlog to Product backlog on the Community-Tech board.
MusikAnimal subscribed.

Going to throw this in the freezer if that's alright :) I think it might be a good hackathon project, or for a rainy, lonely and nerdy weekend.

Anti-Harassment doesn't have a freezer, but feel free to toss it in the Comm Tech freezer. ⛄️