Page MenuHomePhabricator

GeoData\Searcher::performSearch() should choose the appropriate index instead of querying everything
Closed, ResolvedPublic

Description

Which indices to query in elasticsearch depends on the namespaces being queried. By default geosearch api only queries ns 0, but it runs the query against the wiki alias, which always queries both $wiki_content and $wiki_general. Making this change should, mostly, cut the number of geo queries elasticsearch makes internally in half by querying the appropriate index instead of both.

Cirrus deals with that here:

https://github.com/wikimedia/mediawiki-extensions-CirrusSearch/blob/master/includes/Searcher.php#L1549-L1566

which is then used here:

https://github.com/wikimedia/mediawiki-extensions-CirrusSearch/blob/master/includes/Searcher.php#L915

Perhaps some light refactoring on both ends is needed to share that code.

Event Timeline

Change 293143 had a related patch set uploaded (by EBernhardson):
Push index selection by namespace into Connection class

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

Change 293143 merged by jenkins-bot:
Push index selection by namespace into Connection class

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

Change 293216 had a related patch set uploaded (by MaxSem):
Use proper index type

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

MaxSem moved this task from Backlog to Needs review on the Maps-Sprint board.

Change 293216 merged by jenkins-bot:
Use proper index type

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