Page MenuHomePhabricator

Help panel: figure out search API options
Closed, ResolvedPublic

Description

Following our all-hands conversation, this task is to document, discuss, and hopefully improve the search API options used by the Help Panel.

These are the options currently being used:

  • action: 'query',
  • list: 'search',
  • srnamespace: this.searchNamespaces.join( '|' ), // configurable per wiki, Wikipedia and Help generally
  • srwhat: 'text', // search the arcticle text
  • srprop: 'snippet', // please return a snippet of the article for each result
  • srsearch: <text from the input as is>

For reference: search API documentation

Event Timeline

MMiller_WMF renamed this task from Figure out search API options for Help Panel to Help panel: figure out search API options.Feb 4 2019, 10:14 PM
  • Since this is search-as-you-type we might want to try appending * to the unfinished final word. Maybe something simple like /\s$/.test(qs) ? qs : (qs + '*'). This will make the search slower though, which isn't as great for search as you type. Long term search as you type against full text would have to be implemented differently to get decent performance out of it, but for testing this is likely sufficient. (Rough sketch of the longer term would be context aware query completion, issuing a search for the most likely query starting with 'foo bar ba' instead of searching for 'foo bar' and most words that start with 'ba'.)
  • If any templates can be determined to be either positive or negative signals for the types of results desired they can be appended to the search string with boost-templates.
  • Enabling rewrites might help, in general it doesn't typically hurt. This is currently only triggered when there are zero results, giving a net effect of reduce the number of queries with zero results. The rewriting finds rare or unseen terms in the query and tries to replace them with a more common word. The statistics are based only on words found in article titles, sometimes giving non-sensical results.

@EBernhardson thanks for these notes!

@Catrope and I discussed, we will leave our implementation as it is right now but might return to this based on how users interact with it once the feature is live.

Since we gathered some information and we have decided not to take any action at the moment, I'm going to resolve this. Thank you, @EBernhardson.