mirror of
https://we.phorge.it/source/phorge.git
synced 2024-11-26 08:42:41 +01:00
Return fulltext tokens from the Ferret fulltext engine
Summary: Ref T12819. These render the little "Searched For: X, Y, U V" hint about how something was parsed. (This might get a "substring" color or "title only" color or something in the future.) Test Plan: {F5178807} Reviewers: chad Reviewed By: chad Maniphest Tasks: T12819 Differential Revision: https://secure.phabricator.com/D18589
This commit is contained in:
parent
dd3f05ec25
commit
39b74572e6
2 changed files with 15 additions and 0 deletions
|
@ -86,6 +86,10 @@ final class PhabricatorFerretFulltextStorageEngine
|
|||
$type_results[$type] = $results;
|
||||
|
||||
$metadata += $engine_query->getFerretMetadata();
|
||||
|
||||
if (!$this->fulltextTokens) {
|
||||
$this->fulltextTokens = $engine_query->getFerretTokens();
|
||||
}
|
||||
}
|
||||
|
||||
$list = array();
|
||||
|
|
|
@ -1469,6 +1469,17 @@ abstract class PhabricatorCursorPagedPolicyAwareQuery
|
|||
return $this;
|
||||
}
|
||||
|
||||
public function getFerretTokens() {
|
||||
if (!$this->supportsFerretEngine()) {
|
||||
throw new Exception(
|
||||
pht(
|
||||
'Query ("%s") does not support the Ferret fulltext engine.',
|
||||
get_class($this)));
|
||||
}
|
||||
|
||||
return $this->ferretTokens;
|
||||
}
|
||||
|
||||
public function withFerretConstraint(
|
||||
PhabricatorFerretEngine $engine,
|
||||
array $fulltext_tokens) {
|
||||
|
|
Loading…
Reference in a new issue