Push pagination decision for search into SearchEngine
authorErik Bernhardson <ebernhardson@wikimedia.org>
Tue, 19 Dec 2017 22:19:49 +0000 (14:19 -0800)
committerErik Bernhardson <ebernhardson@wikimedia.org>
Mon, 11 Jun 2018 20:35:44 +0000 (13:35 -0700)
commit2a43939ffb0cfb0808c2b56430be4f5e88d863ee
treeae9e2544f42db16a944721a0e6feec1682f18212
parentc2a308075f6a1740f06e05fbb2576a59d6ab0c87
Push pagination decision for search into SearchEngine

Various code using the search engine shouldn't need to implement it's
own methods, such as over-fetching, to determine if there are more
results available. This should be knowledge internal to search that is
exposed by a boolean.

Change-Id: Ica094428700637dfdedb723b03f6aeadfe12b9f4
14 files changed:
autoload.php
includes/api/ApiQueryPrefixSearch.php
includes/api/ApiQuerySearch.php
includes/api/SearchApi.php
includes/search/PaginatingSearchEngine.php [new file with mode: 0644]
includes/search/SearchEngine.php
includes/search/SearchResultSet.php
includes/search/SearchSuggestionSet.php
tests/common/TestsAutoLoader.php
tests/phpunit/includes/api/ApiQueryPrefixSearchTest.php [new file with mode: 0644]
tests/phpunit/includes/search/SearchEnginePrefixTest.php
tests/phpunit/includes/search/SearchResultSetTest.php
tests/phpunit/mocks/search/MockCompletionSearchEngine.php [new file with mode: 0644]
tests/phpunit/mocks/search/MockSearchResultSet.php