Page MenuHomePhabricator

Build the Vue.js search component network client
Open, MediumPublic5 Estimated Story Points

Description

This is a skeletal task for implementing a network client for the new search Desktop Improvements Project / FAWG search experience. The interface approach taken by Popups (RESTBase / Action ) seems to have worked well and allows the underlying service to be swapped between the Action API, RESTBase, and mocked data so it should probably be considered for this task.

Questions

  • Are the client responses DWIM compatible? If not, should we modify the gadget? If so, do we need a gadget API? Would it be simpler to build the transliteration into the client and just issue a second request? It's a 100 lines.
  • Is the caching sensible? For example, if a user types "f", "o", "o", <backspace>, can the browser served cached results for "fo"?
  • Do we need an A/B test for the network clients?
  • What types are nullable, undefined, or missing? It's not yet documented as far as I can tell.
  • What behavior do we want for submission? Portals uses //wikipedia.org/search-redirect.php, wikis use /w/index.php. The former lands on https://en.wikipedia.org/w/index.php?cirrusUserTesting=glent_m0&search=no+matching+query&title=Special%3ASearch&go=Go&ns0=1 and he latter lands on https://en.wikipedia.org/wiki/Special:Search?search=no+matching+query&go=Go&ns0=1. Matches (including redirects) go to the page on both.

Docs and examples

Acceptance criteria

  • Compare to the Action API and Portals implementation.
  • DWIM works or a task or spike for how to support it is made.
  • Search implementation is compatible with WVUI browser targets.

Related Objects

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald TranscriptFeb 4 2020, 8:58 PM
Demian added a subscriber: Demian.Feb 4 2020, 9:33 PM
ovasileva moved this task from Incoming to Needs Prioritization on the Readers-Web-Backlog board.

Can you elaborate on what you mean network client? Are you proposing the current API we use for showing search results in the mobile site / Vector autocomplete is insufficient in some way and we should build a REST alternative? We use the mediawiki API on mobile and it works fine. My understanding is the new desktop search will be no different. Also given Vector is the most used 3rd party skin a REST base service will need to be accompanied by a mediawiki api alternative for third parties.

The only reason we used RESTbase service in Popups was caching (not an issue as far as I can see here) and technical limitations with what we could do with PHP (no good DOM parser)

It seems if we can avoid building a network client we should.

@Jdlrobson, I think there's some confusion due to the wording. This task is about building a network client for the new Core REST API (/cc @EvanProdromou) which targets our use case. RESTBase was only mentioned in the context of Popups' approach for easily swapping out clients for testing. Does that make sense?

Okay thanks so it sounds like we want to replace the existing prefix search with a more powerful full text search as part of desktop refresh? Do we have a sense of the timeline for this service?

Is this task a spike to talk to @EvanProdromou to discuss the specification of that new search API? or this an Epic which we're going to flesh out with more details? I noticed this was moved into "needs priorization" so my assumption is it's coming into the sprint very soon and it caught me off guard.

Currently discussing this with @EvanProdromou to determine what the plan looks like from their side. Let's discuss further on Thursday during our team meeting.

Niedzielski changed the task status from Open to Stalled.Apr 3 2020, 6:09 PM
Niedzielski added a subscriber: JTannerWMF.

I'm marking this stalled to reflect updates from @ovasileva and @JTannerWMF. This task can't be worked on until we have guidance on whether the Search team will have the capacity to finish the enhancements needed or the decision is made to build on the existing API instead. In the latter case, this task's description describes building the network client in a way that it can be swapped out at a later date.

Niedzielski renamed this task from Build the search component network client to Build the Vue.js search component network client.Apr 5 2020, 4:21 PM
Niedzielski changed the task status from Stalled to Open.Apr 7 2020, 2:00 PM
Niedzielski removed ovasileva as the assignee of this task.Apr 7 2020, 2:04 PM
Niedzielski added a subscriber: ovasileva.

Updated status to open and added a dependency based on Olga's update. We can't complete this task until T245672 is done but I think we can start on it with mocked data (e.g., fake data in Vector's Storybook layer and test data in Popups' tests). @ovasileva, I've also taken the liberty of removing you as a assignee now that we have more clarity on this task. Please add yourself back if that was a mistake!

Updated status to open and added a dependency based on Olga's update. We can't complete this task until T245672 is done but I think we can start on it with mocked data (e.g., fake data in Vector's Storybook layer and test data in Popups' tests). @ovasileva, I've also taken the liberty of removing you as a assignee now that we have more clarity on this task. Please add yourself back if that was a mistake!

sounds good, thanks @Niedzielski!

Niedzielski updated the task description. (Show Details)May 4 2020, 6:31 PM
Niedzielski updated the task description. (Show Details)May 5 2020, 4:17 PM
Niedzielski updated the task description. (Show Details)May 11 2020, 3:50 AM
Niedzielski updated the task description. (Show Details)May 11 2020, 3:56 AM
Niedzielski updated the task description. (Show Details)May 21 2020, 7:16 PM
Niedzielski updated the task description. (Show Details)May 28 2020, 4:28 PM
Niedzielski updated the task description. (Show Details)Jun 11 2020, 3:35 PM
Niedzielski added a subscriber: holger.knust.

Assigning to @holger.knust to track follow-up on result order.

Niedzielski updated the task description. (Show Details)Jun 18 2020, 6:40 PM

@holger.knust, please also verify with @eprodromou what the intended CORS operation is.

We'd like to use the new production REST APIs in our demos and development outside of Wikimedia domains. For example, https://en.wikipedia.org/w/rest.php/v1/search/title?q=foo. For the Action API, we would enable more permissive server response headers by adding the origin=* parameter. Is there a similar mechanism for the MediaWiki REST API?

I also wasn't sure if it would be possible to search from fr.wikipedia.org, for example, from en.wikipedia.org.

@eprodromou any update for us on CORS or result order? We'd love to use the new REST API in the new search experience. /cc @holger.knust

Niedzielski updated the task description. (Show Details)Jul 10 2020, 3:32 AM
ovasileva set the point value for this task to 5.Wed, Jul 15, 4:36 PM

PR: https://github.com/wikimedia/wvui/pull/72

Not sure if we need the excerpt field but the search/title endpoint seems to always return the title in the excerpt property:

https://en.wikipedia.org/w/rest.php/v1/search/title?q=the%20rebel&limit=3

{
    "pages": [
        {
            "id": 52294167,
            "key": "The_Rebel_(South_Korean_TV_series)",
            "title": "The Rebel (South Korean TV series)",
            "excerpt": "The Rebel (South Korean TV series)",
            "description": "television series",
            "thumbnail": {
                "mimetype": "image/jpeg",
                "size": null,
                "width": 133,
                "height": 200,
                "duration": null,
                "url": "//upload.wikimedia.org/wikipedia/en/thumb/8/85/Poster_for_Thief_Who_Stole_the_People.jpg/133px-Poster_for_Thief_Who_Stole_the_People.jpg"
            }
        },
        {
            "id": 29730098,
            "key": "The_Rebel_Flesh",
            "title": "The Rebel Flesh",
            "excerpt": "The Rebel Flesh",
            "description": "episode of Doctor Who",
            "thumbnail": null
        },
        {
            "id": 5308866,
            "key": "The_Rebel_(TV_series)",
            "title": "The Rebel (TV series)",
            "excerpt": "The Rebel (TV series)",
            "description": "TV series",
            "thumbnail": {
                "mimetype": "image/jpeg",
                "size": null,
                "width": 150,
                "height": 200,
                "duration": null,
                "url": "//upload.wikimedia.org/wikipedia/commons/thumb/a/ac/Nick_Adams_The_Rebel.JPG/150px-Nick_Adams_The_Rebel.JPG"
            }
        }
    ]
}

I'm tempted to remove it from the internal TypeScript interface.

I've noticed that the Accept-Language header doesn't seem to make a difference. So, not sending it at this time.

Thank you, @bearND. Please file bug reports against the MediaWiki-REST-API for any issues encountered.

Niedzielski updated the task description. (Show Details)Thu, Aug 6, 2:30 PM