Page MenuHomePhabricator

Make Postgres search use a searchindex table
Open, MediumPublic

Description

Postgres currently uses columns in specific tables (pagecontent.textvector and page.titlevector, both of type tsvector) to store search index information. Postgres also currently uses triggers/procedures to maintain these tables. It needs to be converted to use a searchindex table like MySQL.

This relates to MCR Schema Migration, because it prepares for when we want SearchMySQL and so on to handle more than just the main slot. By using a searchindex table, the changes to SearchPostgres will be similar rather than entirely different.

Details:

  • add a searchindex table, similar to the MySQL one, but adapted to Postgres data types. Basically page.titlevector becomes searchindex.si_title and pagecontent.textvector becomes searchindex.si_text. searchindex.si_page works exactly like it does in MySQL.
  • add related code to maintain this table. Per T164898, we don't want to keep using triggers for this. SearchPostgres::update() should do it, similar to what SearchMySQL::update() does. Same for ::updateTitle().
  • add necessary documentation and install/update support for these db changes
  • modify searchPostgres.php to use the new db changes

See T198341 for the discussion that led to this task.

Event Timeline

CBogen triaged this task as Medium priority.Aug 27 2020, 8:58 PM

Change 696411 had a related patch set uploaded (by Ladsgroup; author: Ladsgroup):

[mediawiki/core@master] Migrate searchindex to abstract schema

https://gerrit.wikimedia.org/r/696411

Change 696411 merged by jenkins-bot:

[mediawiki/core@master] Migrate searchindex to abstract schema

https://gerrit.wikimedia.org/r/696411

Change 697129 had a related patch set uploaded (by Ladsgroup; author: Ladsgroup):

[mediawiki/core@master] [WIP] Migrate searchindex table operations to a dedicated class

https://gerrit.wikimedia.org/r/697129

Change 697129 abandoned by Ladsgroup:

[mediawiki/core@master] [WIP] Migrate searchindex table operations to a dedicated class

Reason:

I don't have time to work on it atm, feel free to pick it up

https://gerrit.wikimedia.org/r/697129