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

Restricted Application added subscribers: Zppix, Aklapper. · View Herald TranscriptJun 7 2016, 12:07 AM
EBernhardson updated the task description. (Show Details)Jun 7 2016, 12:08 AM

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 claimed this task.Jun 7 2016, 9:05 PM
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

MaxSem closed this task as Resolved.Jul 5 2016, 8:27 PM