Deprecate SearchResult::termMatches()
authorDavid Causse <dcausse@wikimedia.org>
Wed, 12 Jun 2019 09:02:10 +0000 (11:02 +0200)
committerErik Bernhardson <ebernhardson@wikimedia.org>
Thu, 27 Jun 2019 15:44:06 +0000 (08:44 -0700)
commit92c20832f14439629a0f4028946b06ff5bcaab3a
tree1905e1a7eb90f68b819262551ae76dce4281512b
parentac4f78fa1398d7fd4d5dbb0565f1d9abbaf5baf0
Deprecate SearchResult::termMatches()

And start indicating that hooks relying on this data might become
unreliable as this data is only populated by SearchDatabase search
engines.

This information was only populated by SearchDatabase implementations
and due to bad initial design of SearchResult[Set] (now fixed) it forced
users of these classes to carry this information for the sole purpose of
highlighting.
Because SearchEngine can now own their SearchResult[Set] implementations
nothing that is engine specific should be exposed outside of these
specific implementations.
If there are some logic that still requires access to such list of terms
they should be made engine specific by guarding their code against
instanceof SqlSearchResult.

Change-Id: I38b82c5e4c35309ee447edc3ded60ca6a18b247a
Depends-On: I53fe37c65c7940f696c1e184125e01e592a976e4
16 files changed:
RELEASE-NOTES-1.34
autoload.php
docs/hooks.txt
includes/api/ApiQuerySearch.php
includes/search/SearchDatabase.php
includes/search/SearchEngine.php
includes/search/SearchResult.php
includes/search/SearchResultSet.php
includes/search/SqlSearchResult.php [new file with mode: 0644]
includes/search/SqlSearchResultSet.php
includes/widget/search/BasicSearchResultSetWidget.php
includes/widget/search/FullSearchResultWidget.php
includes/widget/search/InterwikiSearchResultWidget.php
includes/widget/search/SearchResultWidget.php
includes/widget/search/SimpleSearchResultWidget.php
tests/phpunit/includes/search/SearchEngineTest.php