Changeset View
Changeset View
Standalone View
Standalone View
src/applications/maniphest/query/ManiphestTaskSearchEngine.php
| Show First 20 Lines • Show All 86 Lines • ▼ Show 20 Lines | return array( | ||||
| ->setDescription( | ->setDescription( | ||||
| pht('Search for tasks with given subtypes.')) | pht('Search for tasks with given subtypes.')) | ||||
| ->setDatasource(new ManiphestTaskSubtypeDatasource()) | ->setDatasource(new ManiphestTaskSubtypeDatasource()) | ||||
| ->setIsHidden($hide_subtypes), | ->setIsHidden($hide_subtypes), | ||||
| id(new PhabricatorSearchTextField()) | id(new PhabricatorSearchTextField()) | ||||
| ->setLabel(pht('Contains Words')) | ->setLabel(pht('Contains Words')) | ||||
| ->setKey('fulltext'), | ->setKey('fulltext'), | ||||
| id(new PhabricatorSearchTextField()) | id(new PhabricatorSearchTextField()) | ||||
| ->setLabel(pht('Matches (Prototype)')) | ->setLabel(pht('Query (Prototype)')) | ||||
| ->setKey('ferret') | ->setKey('query') | ||||
| ->setIsHidden($hide_ferret), | ->setIsHidden($hide_ferret), | ||||
| id(new PhabricatorSearchThreeStateField()) | id(new PhabricatorSearchThreeStateField()) | ||||
| ->setLabel(pht('Open Parents')) | ->setLabel(pht('Open Parents')) | ||||
| ->setKey('hasParents') | ->setKey('hasParents') | ||||
| ->setAliases(array('blocking')) | ->setAliases(array('blocking')) | ||||
| ->setOptions( | ->setOptions( | ||||
| pht('(Show All)'), | pht('(Show All)'), | ||||
| pht('Show Only Tasks With Open Parents'), | pht('Show Only Tasks With Open Parents'), | ||||
| Show All 40 Lines | protected function getDefaultFieldOrder() { | ||||
| return array( | return array( | ||||
| 'assignedPHIDs', | 'assignedPHIDs', | ||||
| 'projectPHIDs', | 'projectPHIDs', | ||||
| 'authorPHIDs', | 'authorPHIDs', | ||||
| 'subscriberPHIDs', | 'subscriberPHIDs', | ||||
| 'statuses', | 'statuses', | ||||
| 'priorities', | 'priorities', | ||||
| 'subtypes', | 'subtypes', | ||||
| 'query', | |||||
| 'fulltext', | 'fulltext', | ||||
| 'ferret', | |||||
| 'hasParents', | 'hasParents', | ||||
| 'hasSubtasks', | 'hasSubtasks', | ||||
| 'parentIDs', | 'parentIDs', | ||||
| 'subtaskIDs', | 'subtaskIDs', | ||||
| 'group', | 'group', | ||||
| 'order', | 'order', | ||||
| 'ids', | 'ids', | ||||
| '...', | '...', | ||||
| ▲ Show 20 Lines • Show All 63 Lines • ▼ Show 20 Lines | protected function buildQueryFromParameters(array $map) { | ||||
| if ($map['hasSubtasks'] !== null) { | 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['query'])) { | ||||
| $raw_query = $map['ferret']; | $raw_query = $map['query']; | ||||
| $compiler = id(new PhutilSearchQueryCompiler()) | $compiler = id(new PhutilSearchQueryCompiler()) | ||||
| ->setEnableFunctions(true); | ->setEnableFunctions(true); | ||||
| $raw_tokens = $compiler->newTokens($raw_query); | $raw_tokens = $compiler->newTokens($raw_query); | ||||
| $fulltext_tokens = array(); | $fulltext_tokens = array(); | ||||
| foreach ($raw_tokens as $raw_token) { | foreach ($raw_tokens as $raw_token) { | ||||
| ▲ Show 20 Lines • Show All 228 Lines • Show Last 20 Lines | |||||