Page MenuHomePhabricator

Introduce keyword interfaces dedicated per usage
Open, MediumPublic

Description

Currently the keywords applies its logic thanks to a broad doApply method.
It currently populates a bunch of states in the SearchContext.
We should introduce different interfaces that fit keywords needs. So far we identified these needs:

  • HighlightingKeyword: pass the HighlightBuilder so that keywords can change the highlighting behavior
  • RescoringKeyword: pass a RescoreBuilder to affect the rescore window components
  • FilteringKeyword: so that they can inject their filters
  • ScoringKeyword (better name needed): so that they can affect the main query scores (e.g. intitle)
  • InitialSearchContextKeyword: so that they can affect the InitialSearchContext (setting the namespaces or limiting search to local results)
  • LegacyKeyword: will have the old doApply method so that we can still support them while we migrate to dedicated interfaces

Keywords will be able to implement multiple interface:

  • prefix will implement InitialSearchContextKeyword and FilteringKeyword
  • intitle will implement FilteringKeyword and ScoringKeyword
  • subpageof/insource/intitle will implement FilteringKeyword and HighlightingKeyword

Event Timeline

dcausse triaged this task as Medium priority.Mar 20 2018, 10:25 AM
dcausse created this task.

Change 422145 had a related patch set uploaded (by DCausse; owner: DCausse):
[mediawiki/extensions/CirrusSearch@master] Add a simple markup interface to identify legacy keywords

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

Change 422146 had a related patch set uploaded (by DCausse; owner: DCausse):
[mediawiki/extensions/GeoData@master] Mark this class as LegacyKeywordFeature

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

Change 423700 had a related patch set uploaded (by DCausse; owner: DCausse):
[mediawiki/extensions/CirrusSearch@master] Generalize function score build to an interface

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

Change 423700 abandoned by DCausse:
Generalize function score build to an interface

Reason:
included in another patch

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

Change 426958 had a related patch set uploaded (by DCausse; owner: DCausse):
[mediawiki/extensions/CirrusSearch@master] Add KeywordFeature::parseValue

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

Change 427138 had a related patch set uploaded (by DCausse; owner: DCausse):
[mediawiki/extensions/GeoData@master] [cirrus] Split geo features per type (filtering vs boosting)

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

Change 427139 had a related patch set uploaded (by DCausse; owner: DCausse):
[mediawiki/extensions/GeoData@master] [cirrus] Add support for KeywordFeature::parseValue

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

Change 427140 had a related patch set uploaded (by DCausse; owner: DCausse):
[mediawiki/extensions/GeoData@master] [cirrus] Add support for BoostFunctionFeature

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

Change 427695 had a related patch set uploaded (by DCausse; owner: DCausse):
[mediawiki/extensions/CirrusSearch@master] Introduce CrossSearchStrategy

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

Change 426958 merged by jenkins-bot:
[mediawiki/extensions/CirrusSearch@master] Add KeywordFeature::parseValue

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

Change 427695 merged by jenkins-bot:
[mediawiki/extensions/CirrusSearch@master] Introduce CrossSearchStrategy

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

Change 429206 had a related patch set uploaded (by DCausse; owner: DCausse):
[mediawiki/extensions/CirrusSearch@master] Unify keyword tests

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

Change 429206 merged by jenkins-bot:
[mediawiki/extensions/CirrusSearch@master] Unify keyword tests

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

Change 422145 merged by jenkins-bot:
[mediawiki/extensions/CirrusSearch@master] Add a simple markup interface to identify legacy keywords

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

Change 427140 abandoned by DCausse:
[cirrus] Add support for BoostFunctionFeature

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

Change 427139 abandoned by DCausse:
[cirrus] Add support for KeywordFeature::parseValue

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

Change 427138 abandoned by DCausse:
[cirrus] Split geo features per type (filtering vs boosting)

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

Change 422146 abandoned by DCausse:
Mark this class as LegacyKeywordFeature

Reason:
not needed

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