1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-11-22 23:02:42 +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:
epriestley 2017-09-11 16:35:09 -07:00
parent dd3f05ec25
commit 39b74572e6
2 changed files with 15 additions and 0 deletions

View file

@ -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();

View file

@ -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) {