Commit graph

16 commits

Author SHA1 Message Date
Stanislav Malyshev
7e18cfc3b5 Infrastructure for augmenting search results
Bug: T117493
Change-Id: Ia5413a7846cc961026a2dc3542b619493bc76a23
2016-09-15 15:44:03 -07:00
Erik Bernhardson
5f26e87b79 search: getInterwikiResults returns array of SearchResultSets
This function was incorrectly annotated. We can clearly see from the
code that uses it, such as in SpecialSearch, that this is an array of
SearchResultSet objects.

Bug: T132625
Change-Id: I4af07d3c9a9b08fd1fa438ddb6b781f78472b26c
2016-04-14 09:04:12 -07:00
Erik Bernhardson
15483b22d7 Add a rewind function to SearchResultSet
This is implemented in CirrusSearch so the result set can be looped
through multiple times. In general having a rewind function on any
iterator is probably a good idea, so pushing it into the upstream
interface.

Change-Id: Iaac9c11d8742288610011a2a0f6282944d35d5f3
2016-04-13 14:15:31 -07:00
Kunal Mehta
6e9b4f0e9c Convert all array() syntax to []
Per wikitech-l consensus:
 https://lists.wikimedia.org/pipermail/wikitech-l/2016-February/084821.html

Notes:
* Disabled CallTimePassByReference due to false positives (T127163)

Change-Id: I2c8ce713ce6600a0bb7bf67537c87044c7a45c4b
2016-02-17 01:33:00 -08:00
Justin Du
3b0f55c492 Split SearchResultSet.php classes
Change autoload.php file to accomodate the split

Bug: T122637
Change-Id: I3a326aa329c3be64662825ac06b169ae96b8f53c
2016-01-03 17:12:10 -06:00
Stanislav Malyshev
46a13941f9 Displaying search results for multiple wikis
Uses fully translated string like search-interwiki-results-abwiki
which should be present in WikimediaMessages.

Requires Ic4bdd9462f844febea2e402e4b89d9dcc4c836b6
Supports I0d0efacf3066b3b5fe0bfcb058dd0b0f9988ccae

Bug: T112349
Change-Id: Ib6524bc79e1648ccf6adc5745f0dbc4c26dcb0d2
2015-10-22 14:34:41 -07:00
Thiemo Mättig
56d2a644f7 Add null to @return tags if a method can return null
Change-Id: I420998351663d92c4a101f61842e40591eebcd5f
2015-10-05 17:53:13 +02:00
Erik Bernhardson
23acf6e70f Move query rewriting into search backend
Special:Search recently gained query rewriting behavior when the
original query returned no results.  We want to expose this query
rewriting behavior to both api and web requests.  Additionally we
want to be able to test different configurations of the query
suggestions.  This patch allows for both by moving the rewriting
from core into the search backend.

This defaults to enabled for Special:Search, and disabled for
ApiQuerySearch. Internal code that talks to the search backend
needs to specifically enable this feature.

Bug: T106888
Change-Id: I0a8f75759f9148f53358707369b8a7128215de86
2015-08-31 22:41:05 -07:00
Erik Bernhardson
c24303d6b0 Search: Allow searchContainedSyntax to be defined by constructor
The SearchResultSet is returned where no query is performed because it
is known ahead of time that no result exists. In cases where that is
known due to the syntax of the query (e.g. the syntax requires
searching a category that does not exist) this searchContainedSyntax
method returns the wrong value. This patch makes it possible for the
instantiating code to properly set the return value of this method.

Change-Id: I7b7be24f5630a48d2a561e4fda9cec696a8cacf9
2015-05-18 16:19:16 -07:00
Chad Horohoe
9b3f84e763 SearchResult: clean up construction
- Remove old pre-1.17 constructor format. No core or extension callers
- Remove only usage of newFromRow(), needless abstraction

Change-Id: Ifad161aa36837bb4c8b5c9aecac1c46e2e6cc84c
2014-09-12 12:39:44 -07:00
Brian Wolff
8c953947ff rm $wgCountTotalSearchHits. It was broken.
If $wgCountTotalSearchHits was set to true, then the total
number of hits returned was zero, which caused Special:Search
to display no results.

I'm opting to remove the feature (although I don't have any
strong opinions about removal vs changing Special:Search), since
if someone both cares about performance and has a wiki where its
big enough to matter, they are going to need to use Cirrus anyways.

Change-Id: I1c3b908ae5423ce3dfbdc22b1a68dd81a85698aa
2014-07-08 03:41:13 -03:00
Chad Horohoe
bea8e24db2 SearchResultSet: remove hasResults(), unused
SolrStore, MWSearch and CirrusSearch all implement this and are
now free to drop their implementations.

Change-Id: Ia04bd3fc8526c35c3c9590c7fe4e2db2bc120283
2014-06-20 07:24:09 -07:00
Chad Horohoe
ff00b052ce Clean up database-backed SearchResultSets
SqlSearchResultSet basically handles all of the work in a DB-agnostic
manner. Remove specific implementations for MySQL, Mssql and Sqlite

Change-Id: Iae3fd5cc40dfbc50917be73d7ace668681e4148a
2014-04-22 12:56:36 -07:00
umherirrender
dcf6955e5c Fixed some @params documentation (includes/*)
Swapped some "$var type" to "type $var" or added missing types
before the $var. Changed some other types to match the more common
spelling. Makes beginning of some text in captial.

Change-Id: Ifbb1da2a6278b0bde2a6f6ce2e7bd383ee3fb28a
2014-04-20 23:33:05 +02:00
Chad Horohoe
692257f959 Remove completely useless implementation of getInfo()
Embedding random strings in Special:Search's comments doesn't
help debugging and just increases page size.

Bug: 62768
Change-Id: I51270aa3f2cba921841e2d8ebbd4fa665542f8a9
2014-03-19 20:20:31 +00:00
Chad Horohoe
7fc1a5b137 Break up SearchEngine.php into a couple of other files
Change-Id: I753eec1d0cf78f2ea08897c7fd3b83f2c88be18d
2014-03-19 20:14:17 +00:00