phacility/phabricator · warning · PhutilArgumentUsageException

Type "%s" matches multiple indexable objects. Use a more spe

Error message

Type "%s" matches multiple indexable objects. Use a more specific string. Matching objects are: %s.

What it means

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.

Source

Thrown at src/applications/search/management/PhabricatorSearchManagementIndexWorkflow.php:401

    foreach ($objects as $object) {
      $all_types[] = get_class($object);
    }
    sort($all_types);
    $type_list = implode(', ', $all_types);

    foreach ($type_map as $type => $normalized_type) {
      $matches = idx($matches_map, $type);
      if (!$matches) {
        throw new PhutilArgumentUsageException(
          pht(
            'Type "%s" matches no indexable objects. '.
            'Supported types are: %s.',
            $type,
            $type_list));
      }

      if (count($matches) > 1) {
        throw new PhutilArgumentUsageException(
          pht(
            'Type "%s" matches multiple indexable objects. Use a more '.
            'specific string. Matching objects are: %s.',
            $type,
            implode(', ', $matches)));
      }
    }

    return $object_matches;
  }

  private function loadIndexVersions($phid) {
    $table = new PhabricatorSearchIndexVersion();
    $conn = $table->establishConnection('r');

    return queryfx_all(
      $conn,
      'SELECT extensionKey, version FROM %T WHERE objectPHID = %s

View on GitHub (pinned to 5720a38cfe)

Solutions

  1. Pick a longer substring from the matches listed in the message
  2. Use the full class name, e.g. `--type DifferentialRevision`
  3. If you actually want all matches, run the command once per matched class

Example fix

# before
bin/search index --type diff

# after
bin/search index --type DifferentialDiff
Defensive patterns

Strategy: validation

Validate before calling

$classes = id(new PhutilClassMapQuery())
  ->setAncestorClass('PhabricatorIndexableInterface')
  ->execute();
$names = array_map('strtolower', array_map('get_class', $classes));
$needle = strtolower($type);
$matches = array_filter($names, function ($n) use ($needle) {
  return strpos($n, $needle) !== false;
});
if (count($matches) !== 1) {
  // require exactly one match before invoking bin/search index --type
}

Prevention

When it happens

Trigger: `--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.

Common situations: Forks or custom applications adding similarly named indexable classes; broad prefixes like "phabricator", "application", "repository"; using an abbreviated name that happens to occur elsewhere.

Related errors


AI-assisted analysis of phacility/phabricator@5720a38cfe (2026-08-21). Data as JSON: /api/errors/8a41b906d1d65e40. Report an issue: GitHub.