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:
@@ -86,6 +86,10 @@ final class PhabricatorFerretFulltextStorageEngine
|
|||||||
$type_results[$type] = $results;
|
$type_results[$type] = $results;
|
||||||
|
|
||||||
$metadata += $engine_query->getFerretMetadata();
|
$metadata += $engine_query->getFerretMetadata();
|
||||||
|
|
||||||
|
if (!$this->fulltextTokens) {
|
||||||
|
$this->fulltextTokens = $engine_query->getFerretTokens();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$list = array();
|
$list = array();
|
||||||
|
|||||||
@@ -1469,6 +1469,17 @@ abstract class PhabricatorCursorPagedPolicyAwareQuery
|
|||||||
return $this;
|
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(
|
public function withFerretConstraint(
|
||||||
PhabricatorFerretEngine $engine,
|
PhabricatorFerretEngine $engine,
|
||||||
array $fulltext_tokens) {
|
array $fulltext_tokens) {
|
||||||
|
|||||||
Reference in New Issue
Block a user