Page MenuHomePhabricator

TemplateData API should allow for partial search
Open, Needs TriagePublic

Description

Unless we're missing something, it's really not possible to get results for templates' while using a custom word search.

For example. If I search for 'boo', I should find all of these:

  • Template:Boo
  • Template:Foo boo bar
  • Template:Cite book
  • Template:Book

That doesn't seem to be possible right now.

Using the straight-forward API request:

	action: 'templatedata',
	format: 'json',
	formatversion: '2',
	titles: [SEARCHSTRING],
	redirects: '1';,
	includeMissingTitles: '1',

That results in finding full words only:

  • Template:Boo
  • Template:Foo boo bar

Using the generator with prefix search:

		action: 'templatedata',
		generator: 'search',
		gsrsearch: this.getValue(),
		gsrnamespace: 10,
		redirects: '1';,
		includeMissingTitles: '1',

That results in finding only Templates that start with 'boo':

  • Template:Boo
  • Template:Book

If we search through action=query&list=search we can find templates, and we find all the templates we need -- but we also find a lot of redundant and unnecessary results like Template:Boo/doc and similar.

There should be a good way to have TemplateData API search for partial matches within the text, when searching for templates with and without TemplateData.

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald Transcript

Template data should ideally also allow for searching via template data description, so it can link up and TemplateWizard can subsequently search via TemplateData partial search and TemplateData description text.
https://phabricator.wikimedia.org/T257738

JTannerWMF added a subscriber: JTannerWMF.

While this could be a valuable feature, the Editing team can not prioritize new feature request for VE at this time due to our work on Talk Pages.

It is expected behavior, I'm not sure how expected behavior really falls as a new feature request when it appears to have been missed. A search should be able to search, if it can't something is perceived to be broken.