Newer Version Available

This content describes an older version of this product. View Latest

SOSL Operation Limitations

Two Tooling API objects, EntityDefinition and FieldDefinition, have some SOSL limitations. ExternalString and MetadataComponentDependency (Beta) don’t support SOSL searches.

EntityDefinition and FieldDefinition

EntityDefinition and FieldDefinition support the following SOSL operations:

FIND

  • Literal text search, for example:
    1FIND {account}
  • Text search with a single wildcard, for example:
    1FIND {account*} RETURNING EntityDefinition
    2FIND {account?} RETURNING FieldDefinition
    3FIND {account*fax} RETURNING EntityDefintion
    4FIND {account?fax} RETURNING FieldDefinition
    The wildcard can’t be the first character in a search term, consistent with search behavior for all objects.
  • Quotation marks are supported.
  • The escape character \ (slash) is supported. For example, to search for the character * (asterisk), include the escape character:
    1FIND {account\*}
    2RETURNING EntityDefinition
    .
  • RETURNING is required.
    1FIND {MyString} 
    2RETURNING FieldDefinition
    • Multiple object type names are supported.
      1...RETURNING EntityDefinition, FieldDefinition
    • A field list is supported.
      1... RETURNING EntityDefinition (MasterLabel, QualifiedApiName)
    • WHERE is supported, though logical operators are not.
    • LIMIT is supported.

Example

1FIND {account*} 
2RETURNING FieldDefinition (MasterLabel, NamespacePrefix 
3WHERE EntityDefinitionId='Account')
All other SOSL operations are unsupported. If you include an unsupported expression in a search term, the expression is ignored, except for the following, which cause an error:
  • Multiple wildcards in a search term
  • Unsupported operators OR or NOT
  • Parentheses for grouping operators
  • Morphological tokenization
  • An asterisk wildcard isn’t added at the end of single-character searches.

ExternalString

ExternalString doesn’t support SOSL searches.

MetadataComponentDependency (Beta)

MetadataComponentDependency is a virtual entity, so it doesn’t support SOSL searches.