Page MenuHomePhabricator

Refactor the Searcher class and the SearchContext to allow easy code reuse
Closed, ResolvedPublic

Description

The Searcher class still has some code that is hard to re-use. We should refactor it bit to clean the states in the SearchContext, goal is to :

  • move to a central place the building of the rescore queries
  • limit state changes in the SearchContext to limit dirty sates
  • externalize most of elastic query building code out of the searcher class
  • externalize the search_request building code so it can be reused

Event Timeline

dcausse triaged this task as Medium priority.
dcausse moved this task from needs triage to Current work on the Discovery-Search board.

Change 386179 had a related patch set uploaded (by DCausse; owner: DCausse):
[mediawiki/extensions/Wikibase@master] PrefixSearch don't use mergeRescore

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

Change 386026 had a related patch set uploaded (by DCausse; owner: DCausse):
[mediawiki/extensions/CirrusSearch@master] Externalize some query building code out of the Searcher class

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

Change 386027 had a related patch set uploaded (by DCausse; owner: DCausse):
[mediawiki/extensions/CirrusSearch@master] Kill Searcher::getAndFilterExtraIndexes

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

Change 386028 had a related patch set uploaded (by DCausse; owner: DCausse):
[mediawiki/extensions/CirrusSearch@master] Compute CirrusSearchExtraIndexBoostTemplates on the fly

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

Change 386199 had a related patch set uploaded (by DCausse; owner: DCausse):
[mediawiki/extensions/CirrusSearch@master] SearchContext should allow setting plain rescore profiles

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

Change 386167 had a related patch set uploaded (by DCausse; owner: DCausse):
[mediawiki/extensions/CirrusSearch@master] Try to unify phrase rescore with RescoreBuilder

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

Change 386168 had a related patch set uploaded (by DCausse; owner: DCausse):
[mediawiki/extensions/CirrusSearch@master] Minor cleanup to Search::buildSearch

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

Change 386169 had a related patch set uploaded (by DCausse; owner: DCausse):
[mediawiki/extensions/CirrusSearch@master] Avoid manipulating the Searcher state when building the query

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

Change 386216 had a related patch set uploaded (by DCausse; owner: DCausse):
[mediawiki/extensions/CirrusSearch@master] Externalize Searcher::buildSearch()

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

Change 386026 merged by jenkins-bot:
[mediawiki/extensions/CirrusSearch@master] Externalize some query building code out of the Searcher class

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

Change 386027 merged by jenkins-bot:
[mediawiki/extensions/CirrusSearch@master] Kill Searcher::getAndFilterExtraIndexes

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

Change 386028 merged by jenkins-bot:
[mediawiki/extensions/CirrusSearch@master] Compute CirrusSearchExtraIndexBoostTemplates on the fly

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

Change 386199 merged by jenkins-bot:
[mediawiki/extensions/CirrusSearch@master] SearchContext should allow setting plain rescore profiles

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

Change 386179 merged by jenkins-bot:
[mediawiki/extensions/Wikibase@master] PrefixSearch don't use mergeRescore

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

Change 387558 had a related patch set uploaded (by DCausse; owner: DCausse):
[mediawiki/extensions/CirrusSearch@master] Externalize comp suggest builder code

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

Change 386167 merged by jenkins-bot:
[mediawiki/extensions/CirrusSearch@master] Try to unify phrase rescore with RescoreBuilder

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

Change 386168 merged by jenkins-bot:
[mediawiki/extensions/CirrusSearch@master] Minor cleanup to Search::buildSearch

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

Change 386169 merged by jenkins-bot:
[mediawiki/extensions/CirrusSearch@master] Avoid manipulating the Searcher state when building the query

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

Change 386216 merged by jenkins-bot:
[mediawiki/extensions/CirrusSearch@master] Externalize Searcher::buildSearch()

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

Change 387558 merged by jenkins-bot:
[mediawiki/extensions/CirrusSearch@master] Externalize comp suggest builder code

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

Change 390162 had a related patch set uploaded (by EBernhardson; owner: DCausse):
[mediawiki/extensions/CirrusSearch@wmf/1.31.0-wmf.6] Try to unify phrase rescore with RescoreBuilder

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

Change 390162 merged by jenkins-bot:
[mediawiki/extensions/CirrusSearch@wmf/1.31.0-wmf.6] Try to unify phrase rescore with RescoreBuilder

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

debt subscribed.

so many check-ins, great job, @dcausse!