Changeset View
Changeset View
Standalone View
Standalone View
src/applications/maniphest/query/ManiphestTaskSearchEngine.php
| Show First 20 Lines • Show All 226 Lines • ▼ Show 20 Lines | if ($map['hasSubtasks'] !== null) { | ||||
| $query->withOpenSubtasks($map['hasSubtasks']); | $query->withOpenSubtasks($map['hasSubtasks']); | ||||
| } | } | ||||
| if (strlen($map['fulltext'])) { | if (strlen($map['fulltext'])) { | ||||
| $query->withFullTextSearch($map['fulltext']); | $query->withFullTextSearch($map['fulltext']); | ||||
| } | } | ||||
| if (strlen($map['ferret'])) { | if (strlen($map['ferret'])) { | ||||
| $raw_query = $map['ferret']; | |||||
| $compiler = id(new PhutilSearchQueryCompiler()) | |||||
| ->setEnableFunctions(true); | |||||
| $raw_tokens = $compiler->newTokens($raw_query); | |||||
| $fulltext_tokens = array(); | |||||
| foreach ($raw_tokens as $raw_token) { | |||||
| $fulltext_token = id(new PhabricatorFulltextToken()) | |||||
| ->setToken($raw_token); | |||||
| $fulltext_tokens[] = $fulltext_token; | |||||
| } | |||||
| $query->withFerretConstraint( | $query->withFerretConstraint( | ||||
| id(new ManiphestTask())->newFerretEngine(), | id(new ManiphestTask())->newFerretEngine(), | ||||
| $map['ferret']); | $fulltext_tokens); | ||||
| } | } | ||||
| if ($map['parentIDs']) { | if ($map['parentIDs']) { | ||||
| $query->withParentTaskIDs($map['parentIDs']); | $query->withParentTaskIDs($map['parentIDs']); | ||||
| } | } | ||||
| if ($map['subtaskIDs']) { | if ($map['subtaskIDs']) { | ||||
| $query->withSubtaskIDs($map['subtaskIDs']); | $query->withSubtaskIDs($map['subtaskIDs']); | ||||
| ▲ Show 20 Lines • Show All 211 Lines • Show Last 20 Lines | |||||