{"record":{"id":"8a41b906d1d65e40","repo":"phacility/phabricator","slug":"type-s-matches-multiple-indexable-objects-use","errorCode":null,"errorMessage":"Type \"%s\" matches multiple indexable objects. Use a more specific string. Matching objects are: %s.","messagePattern":"Type \"(.+?)\" matches multiple indexable objects\\. Use a more specific string\\. Matching objects are: (.+?)\\.","errorType":"console","errorClass":"PhutilArgumentUsageException","httpStatus":null,"severity":"warning","filePath":"src/applications/search/management/PhabricatorSearchManagementIndexWorkflow.php","lineNumber":401,"sourceCode":"    foreach ($objects as $object) {\n      $all_types[] = get_class($object);\n    }\n    sort($all_types);\n    $type_list = implode(', ', $all_types);\n\n    foreach ($type_map as $type => $normalized_type) {\n      $matches = idx($matches_map, $type);\n      if (!$matches) {\n        throw new PhutilArgumentUsageException(\n          pht(\n            'Type \"%s\" matches no indexable objects. '.\n            'Supported types are: %s.',\n            $type,\n            $type_list));\n      }\n\n      if (count($matches) > 1) {\n        throw new PhutilArgumentUsageException(\n          pht(\n            'Type \"%s\" matches multiple indexable objects. Use a more '.\n            'specific string. Matching objects are: %s.',\n            $type,\n            implode(', ', $matches)));\n      }\n    }\n\n    return $object_matches;\n  }\n\n  private function loadIndexVersions($phid) {\n    $table = new PhabricatorSearchIndexVersion();\n    $conn = $table->establishConnection('r');\n\n    return queryfx_all(\n      $conn,\n      'SELECT extensionKey, version FROM %T WHERE objectPHID = %s","sourceCodeStart":383,"sourceCodeEnd":419,"githubUrl":"https://github.com/phacility/phabricator/blob/5720a38cfe95b00ca4be5016dd0d2f3195f4fa04/src/applications/search/management/PhabricatorSearchManagementIndexWorkflow.php#L383-L419","documentation":"The --type value in `bin/search index` is a case-insensitive substring match over indexable class names; when one string matches more than one class, the workflow cannot decide which object set you mean and throws this usage exception, listing every matching class. A longer or exact class name is required.","triggerScenarios":"`--type phabricator` (prefix of many classes), `--type diff` matching several diff-related classes, or any short substring that occurs in multiple indexable class names on installs with custom applications.","commonSituations":"Forks or custom applications adding similarly named indexable classes; broad prefixes like \"phabricator\", \"application\", \"repository\"; using an abbreviated name that happens to occur elsewhere.","solutions":["Pick a longer substring from the matches listed in the message","Use the full class name, e.g. `--type DifferentialRevision`","If you actually want all matches, run the command once per matched class"],"exampleFix":"# before\nbin/search index --type diff\n\n# after\nbin/search index --type DifferentialDiff","handlingStrategy":"validation","validationCode":"$classes = id(new PhutilClassMapQuery())\n  ->setAncestorClass('PhabricatorIndexableInterface')\n  ->execute();\n$names = array_map('strtolower', array_map('get_class', $classes));\n$needle = strtolower($type);\n$matches = array_filter($names, function ($n) use ($needle) {\n  return strpos($n, $needle) !== false;\n});\nif (count($matches) !== 1) {\n  // require exactly one match before invoking bin/search index --type\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Prefer full class names for --type to guarantee a unique match","After installing custom applications, re-check that short type strings still resolve uniquely","Parse the match list from the error output when tuning the string"],"tags":["cli","bin-search","usage-error","ambiguous-type"],"backgroundTag":"ambiguous-type-specifier","analyzedSha":"5720a38cfe95b00ca4be5016dd0d2f3195f4fa04","analyzedAt":"2026-08-21T05:07:25.672Z","schemaVersion":2},"datasetVersion":"2026-08-21T11:28:35.574Z"}