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 set the point value for this task to 1.

Nice to have, but not required

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

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

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