Commit graph

49 commits

Author SHA1 Message Date
Bill Pirkle
8f03082521 Remove references to field rev_text_id
Field rev_text_id is being retired as part of MCR Schema Migration.
Remove references to this field from the Postgres search queries.

Bug: T198341
Change-Id: Id3cbf853aacc06709f441a93248b55943097cd11
2019-03-26 10:41:29 -05:00
David Causse
cf41c48f8d Deprecate SearchEngine::replacePrefixes
This should be handled internally by SearchEngine implementations.

Bug: T198860
Change-Id: Ifbfd0fcb81fcacf5228bd2ffcac7b80fca872b2a
Depends-On: I7d4ff9498fa1f4ea66835c634b8931f4c29993fb
2018-07-17 21:56:14 +00:00
jenkins-bot
cc0fe6c4a7 Merge "Deprecate overriding SearchEngine::search*" 2018-05-16 13:31:56 +00:00
Erik Bernhardson
fdc133ef1a Deprecate overriding SearchEngine::search*
The plan is to convert these methods into final, considering
it a removal under the deprecation policy. By making entry
points into the search engine final we provide a guaranteed
point where generic handling can be applied to all search engines.

The first use case for this generic handling is pushing pagination
via overfetch into the SearchEngine class instead of re-implementing
an overfetch in individual parts of the code that perform searches.

Change-Id: I3426d6a2f32d8b368b044b154e1cb70dac007c62
2018-05-15 08:28:28 -07:00
David Causse
0824579606 Make internal search methods private for db implementations
Change-Id: I622f1b35e27de7918e32c4ddd74ceb4e257c5b02
2018-05-09 11:56:27 +02:00
umherirrender
34fe90ac52 Remove empty lines at end of functions
It looks like there is something missing after the last statement
Also remove some other empty lines at begin of functions, ifs or loops
while at these files

Change-Id: Ib00b5cfd31ca4dcd0c32ce33754d3c80bae70641
2016-11-05 11:55:10 +01:00
Bartosz Dziewoński
c161c46d26 Improve code suffering from PHP 5.3's lack of support for foo()[]
I searched for /\$(\S+) = (.+?\(.*?\);)\n.*?\$\1\[/, ignored
everything involving isset(), unset() or array assigments, then
skimmed through the remaining results and changed things where they
made sense. These changes were not automated, so please review them.

Change-Id: Ib37b4c66fc57648470f151ad412210b3629c2538
2016-02-28 22:49:20 +01: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
umherirrender
7724e285fd phpcs: Fix some "Single space expected before elseif"
Found by new version of mediawiki/codesniffer
https://integration.wikimedia.org/ci/job/mediawiki-core-phpcs/1939/consoleFull

Change-Id: I465bf0d1c89603b3dfc9867be3c0b1190829312d
2015-11-01 21:03:18 +01:00
Vivek Ghaisas
c54766586a Fix issues identified by SpaceBeforeSingleLineComment sniff
Change-Id: I048ccb1fa260e4b7152ca5f09b053defdd72d8f9
2015-09-26 23:06:52 +00:00
Jeff
c1371e7f54 PostgreSQL: Fix text search on moved pages
When a page is updated under PostgreSQL, there is code to
de-index all but the most recent version of the page.  But
when a page is moved, it was accidentally de-indexing the
most recent version as well, because rev_text_id is not
incremented in that case.  A simple tweak to the SQL
fixes that.

I added code to the update script to find pages
previously corrupted by this problem and reindex them.

Bug: 66650
Change-Id: I52e1bbbd8592be5e7c7383c225e6b4c19bbe5b9e
2015-02-17 18:15:23 -08:00
Reedy
8e6fa108b8 or -> ||
Change-Id: Ic591f06f70c68bb2912b7f028f7f988eb658375d
2014-10-24 11:26:14 +01:00
Kevin Israel
3daf61814d Remove redundant $db->resultObject() calls
DatabaseBase::query() already passes the value returned by the
database driver (usually an object or resource for SELECT queries)
through $db->resultObject(). There is no need to pass it through
the method a second time to get a ResultWrapper.

Change-Id: I5d34ab2bffb7f236d2f824b4ef0e8670f89d4599
2014-09-19 20:35:55 +00:00
Chad Horohoe
3b7a003589 Reset searchTerms[] before populating.
Otherwise, multiple calls to searchQuery() would accumulate search
terms. searchTerms[] is defined in SearchEngine so we can't just get
rid of it altogether.

Change-Id: Iddbb3920e3a9d5849c99fe90d2d725d16019b51d
2014-09-05 06:51:27 -07:00
Chad Horohoe
af87cb4a3f Remove score display from search engine
Scores are an internal metric that should not be exposed to
users, plus most backends fail to even support it.

Removes PostgresSearch*-specific result classes as they're not
needed anymore.

Change-Id: I00acaabad0565b9a5b3524c992feea366eb74bcc
2014-08-07 14:19:37 +01:00
Chad Horohoe
9643a0a92d Remove SearchResultTooMany
Only worked for Postgres, and only worked halfway at that. Result
sets could be false for many reasons. No results, bad query, database
went to Mars. We shouldn't assume they're always "too many results."

Leave it up to the normal query error logging and move on.

Change-Id: Ieddd163e440ae54b152541d727c1afdbc4ab4fbd
2014-06-20 10:36:47 -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
jenkins-bot
622f2ddb63 Merge "Fixed some @params documentation (includes/*)" 2014-04-22 10:05:49 +00:00
Jeff
96c7f7eaa6 PostgreSQL: Improve speed for page edit in imports
Whenever a new revision is added, a deferred update gets enqueued.
When it is fired, it clears the searchable text from all earlier
revisions for the article.  This becomes very slow for articles
with long revision histories, as it re-clears the textvector even
when it has already been cleared by earlier actions.  This leads to
very high load in the database for runs of importDump.php

This patch improves this situation by adding a condition to the WHERE
clause such that it does not update rows in which the textvector
is already NULL.

PostgreSQL cannot automatically remove such degenerate updates
in general because the updated rows must be locked and have their
transaction markers increased.  However, in this particular case
those things are unimportant.

This change improves the performance of importDump.php on a
wiki with long revision histories by 7 fold, and moves the
major bottleneck from the database to PHP.  It might also
improve the performance of ordinary page edits, but that
was not tested.

There are more improvements that could be made here.  For example,
a partial index or expression index could make it so that already
cleared rows do not have to be visited at all.  Or the deferred
update mechanism could have a notion of "idempotency" so that many
indentical updates enqueued during bulk loading would be condensed
to only a single execution.  However, this change is very much
simpler and is sufficient to shift the bottleneck elsewhere.

Change-Id: I458603767c6a86425010d02ffc1f8079c4b3c9a0
2014-04-20 21:31:07 -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
7e8c48ac3d Remove "include redirects" option from search
Always include redirects. Search results are worse without them
and MWSearch has never respected this option anyway.

Change-Id: I0ebe321a3b14e7960aa98e3225dc5a19ba916e7d
2014-03-26 09:28:26 -07:00
umherirrender
7c314de876 Rename some local vars to start with a lowercase letter
Change-Id: I6e5975ed7351c1439eda19afaba5120c6afa50f1
2014-03-15 21:03:05 +00:00
umherirrender
047c86f26e Fix spacing between two functions
Added and removed some new lines to have one new line between two
functions

Change-Id: I1ccfbd575dd26b160396ef3d3e2e079f5cdbe196
2014-03-15 20:57:23 +00:00
Ladsgroup
a90f1a2d79 Changing URLs of mediawiki.org in scripts to the SSL-based website
http://www.mediawiki.org --> https://www.mediawiki.org

Part 3

Change-Id: Ica633881b1744fa2854f4b012b79dbf5a7e5e7e2
2014-03-13 22:28:14 +00:00
Chad Horohoe
110eb02f3a Begin abstracting more of the database-specific search backend out
There's a lot in the base search implementations that is specific
to the database backed search. This starts moving some of that out
into a shared base class for those.

For starters, let's not grab a connection to the slave DB for
every single search for backends unless they need it.

Change-Id: Ib66696841eea901e04b21dd309784af889a45ab1
2014-01-21 17:53:16 -08:00
umherirrender
6f79eef473 Fixed spacing around parenthesis in includes
Change-Id: Ie8adc00f4ee8ecec4554e584c18d5d2073415397
2013-04-28 15:50:07 +00:00
umherirrender
6c38a5eb72 Fixed spacing in logging/parser/profiler/rl/revdel/search folder
Added spaces before if, foreach
Added some braces for one line statements

Change-Id: I11bbcfa351e945b7bde10c2105d61a3cf5622205
2013-04-20 17:38:24 +02:00
umherirrender
15abcf71ca Added/Removed spaces around string concatenation
And added/removed spaces around some other tokens,
like +, -, *, /, <, >, =, !

Fixed windows newline style

Change-Id: I0b9c8c408f3f6bfc0d685a074d7ec468fb848fc8
2013-04-13 13:36:24 +02:00
umherirrender
6c278b6d7e fix some spacing
* Removed spaces around array index
* Removed double spaces or added spaces to begin or end of function
  calls, method signature, conditions or foreachs
* Added braces to one-line ifs
* Changed multi line conditions to one line conditions
* Realigned some arrays

Change-Id: Ia04d2a99d663b07101013c2d53b3b2e872fd9cc3
2013-03-25 22:22:46 +00:00
Tyler Anthony Romeo
4dcc7961df Fixed @param tags to conform with Doxygen format.
Doxygen expects parameter types to come before the
parameter name in @param tags. Used a quick regex
to switch everything around where possible. This
only fixes cases where a primitve variable (or a
primitive followed by other types) is the variable
type. Other cases will need to be fixed manually.

Change-Id: Ic59fd20856eb0489d70f3469a56ebce0efb3db13
2013-03-11 13:15:01 -04:00
umherirrender
be90ce07b3 fix some spacing
Change-Id: I93f0a87ba7129bc336083e7289247d3150feb606
2013-02-04 19:54:07 +00:00
umherirrender
824fad9956 fix some spacing
Change-Id: I78a97ad87e0bfe724fc851daf6ffeeed81887800
2013-01-26 19:15:35 +01:00
Sam Reed
09a78c1368 More return documentation 2012-02-09 21:36:14 +00:00
Sam Reed
4fc982ebd9 Fix whitespace, documentation 2011-07-09 03:49:25 +00:00
Sam Reed
16842c0b73 Swap else if for elseif
Trimming trailing whitespace also

Doing in 3 commits (2/3), so hopefully reviewable in CR...
2011-06-17 16:05:05 +00:00
Sam Reed
b15737fa83 And even more documentation, the last of this batch 2011-05-28 19:00:01 +00:00
Sam Reed
e514478ba5 Fix function level comments that start with /* not /** 2011-05-21 19:35:16 +00:00
Sam Reed
64be8c7b26 Ununsed variables
Documentation and explicit definitions
2011-02-23 12:35:41 +00:00
Mark A. Hershberger
6e1e4e163d Use the right query parameter. 2011-02-04 00:40:33 +00:00
Mark A. Hershberger
1eb2307caa Results of my work on new-installer and Pg.
* NOTE: this commit removes any semblence of tsearch compatibility with pre-8.3 PostgreSQL
* Make new-installer work against PostgreSQL
* Remove SearchPostgres.php's call to pg_fetch_result.  I think this is the only one outside of the vestigtial old installer code.
2011-02-03 04:06:11 +00:00
Chad Horohoe
bf3e2be8d5 Per comment on bug 26612, we should drop the pre-Postgres 8.3 support with the TSearch2 schema.
This removes a bunch of back-compat code in the installer and search code.
Minimum postgres version is now 8.3
2011-01-28 14:12:26 +00:00
Chad Horohoe
167a8c8917 Partial revert r78450: doQuery() and query() are not the same. You can't just swap one for the other without checking what might be using the result 2011-01-20 02:32:43 +00:00
Aaron Schulz
281018701f Changed doQuery() -> query() 2010-12-15 20:59:29 +00:00
Platonides
a85f03a94f Move storing of $db down to SearchEngine
Fixes the r76809 issue of SearchDbTest not being marked as requiring a Database.
2010-11-22 16:08:12 +00:00
Alexandre Emsenhuber
25ee5e7ae9 * standardised file headers
* added a basic description
* added @file
2010-08-08 10:44:59 +00:00
Platonides
36d86e7ae9 Kill $wgDBversion 2010-07-25 22:09:34 +00:00
Alexandre Emsenhuber
ef5f6cfd0f fixed some doxygen warnings 2010-05-14 20:51:16 +00:00
Max Semenik
4b0299a765 Severely refactored the SearchResultSet descendants system, consolidating most od the code into one class. Ping r58322. 2010-01-09 14:30:55 +00:00
Chad Horohoe
7196442927 Move search related includes to includes/search/ 2009-07-30 22:45:38 +00:00
Renamed from includes/SearchPostgres.php (Browse further)