diff --git a/src/applications/search/fulltextstorage/PhabricatorFerretFulltextStorageEngine.php b/src/applications/search/fulltextstorage/PhabricatorFerretFulltextStorageEngine.php --- a/src/applications/search/fulltextstorage/PhabricatorFerretFulltextStorageEngine.php +++ b/src/applications/search/fulltextstorage/PhabricatorFerretFulltextStorageEngine.php @@ -86,6 +86,10 @@ $type_results[$type] = $results; $metadata += $engine_query->getFerretMetadata(); + + if (!$this->fulltextTokens) { + $this->fulltextTokens = $engine_query->getFerretTokens(); + } } $list = array(); diff --git a/src/infrastructure/query/policy/PhabricatorCursorPagedPolicyAwareQuery.php b/src/infrastructure/query/policy/PhabricatorCursorPagedPolicyAwareQuery.php --- a/src/infrastructure/query/policy/PhabricatorCursorPagedPolicyAwareQuery.php +++ b/src/infrastructure/query/policy/PhabricatorCursorPagedPolicyAwareQuery.php @@ -1469,6 +1469,17 @@ 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) {