Page MenuHomePhabricator

Client Developer specifies maximum number of search results in result set
Closed, ResolvedPublic1 Estimated Story Points

Description

"As a Client Developer, I want to specify the number of pages to return in the search results, so that I have just the right number of results for my user interface."

Passing along a segment size parameter. I don't think we need multiple segments per search; it's also hard to manage that with relevance-based searches.

Propose limit, integer value, default = 50.

Event Timeline

Feedback from @Anomie:

already in the Action API; the REST SearchHandler probably doesn't include this yet but shouldn't be hard to add. It should use PARAM_TYPE => 'limit'.

max_results alternatively could be called limit. limit is a very frequently used term in software development with query languages and API.

WDoranWMF updated the task description. (Show Details)Feb 26 2020, 7:53 PM
WDoranWMF set the point value for this task to 1.
eprodromou triaged this task as Low priority.Feb 26 2020, 8:13 PM

Nice to have, but not required

daniel added a subscriber: daniel.Feb 28 2020, 11:24 AM

If we allow the client to specify a limit, we should also enforce a hard maximum. I'm assuming 100 for now.

Change 575514 had a related patch set uploaded (by Daniel Kinzler; owner: Daniel Kinzler):
[mediawiki/tools/api-testing@master] search/page: add test for limit param

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

daniel claimed this task.Mar 2 2020, 11:46 AM

Change 576016 had a related patch set uploaded (by Daniel Kinzler; owner: Daniel Kinzler):
[mediawiki/core@master] SearchHandler: implement limit parameter

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

Change 576016 merged by jenkins-bot:
[mediawiki/core@master] SearchHandler: implement limit parameter

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

daniel closed this task as Resolved.Mar 4 2020, 5:58 PM

Change 575514 abandoned by Clarakosi:
Move tests for the page/search endpoint to core.

Reason:
Moved to patch on core 576016

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