FIND ALL
Use FIND ALL to search Vault objects and documents when every term in the search phrase must match. Unlike FIND, which can return results matching any term, FIND ALL treats every token generated from the search phrase as a required term (AND logic). This mirrors the All of these Words option in the Vault Advanced Search UI
FIND ALL is especially useful for languages without natural word spacing, such as Chinese, where a single multi-character term is tokenized into multiple pieces. FIND ALL ensures results contain the entire concept rather than any individual piece.
FIND ALLis available in Vault API v26.3+.FIND ALLsupports documents and Vault objects with astandarddata_store.FIND ALLis not supported on raw Vault objects or in attachment subqueries.FIND ALLcannot be combined withFINDin the same query.
You can scope your search to specific fields, document content, or both. When using FIND ALL without SCOPE, VQL uses SCOPE PROPERTIES by default.
Syntax
Section link for SyntaxSELECT {fields}
FROM {query target}
FIND ALL ('{search phrase}')The FIND ALL search phrase must be enclosed in single quotation marks. The entire FIND ALL statement (search phrase and scopes) must be enclosed in parentheses.
The maximum search term length is 250 characters. The minimum search term length is 1 character.
The search phrase is not case sensitive.
Constraints
Section link for ConstraintsFIND ALL enforces the following restrictions:
- No logical operators: Because
FIND ALLimplies a universalANDacross all terms, theAND,OR, andNOToperators are not permitted in the search phrase.NOTcaveat: You can useNOTonly to negate the entire search phrase. For example, Vault supportsFIND ALL (NOT 'broken pills')to find all results without "broken" and without "pills".
- Wildcards: Wildcards are supported, subject to the standard wildcard rules.
- Fuzzy matching: The
DISTANCEoption is supported whenSCOPEis limited to 5 fields or fewer and 3 or fewer search terms use a non-zero distance. - Stemming: Stemming remains active for all tokens.
- The same token limits that apply to
FINDapply toFIND ALL.
Functions & Options
Section link for Functions & OptionsYou can use the following functions and query target options in the FIND ALL clause. For full technical details, see the VQL Functions & Options reference.
Refining Search Scope
Section link for Refining Search ScopeThese options control which fields or content are searched.
| Name | Goal | API Version |
|---|---|---|
SCOPE ALL | Search all fields and document content. | v8.0+ |
SCOPE CONTENT | Search document content only. | v8.0+ |
SCOPE {fields} | Search one specific document field or up to 25 object fields. | v15.0+ |
SCOPE PROPERTIES | Search all picklists and text-based fields (default scope). | v8.0+ |
Advanced Matching
Section link for Advanced MatchingThese functions and options provide more granular control over search results.
| Name | Goal | API Version |
|---|---|---|
DISTANCE | Enable fuzzy search with an edit distance of up to 2. | v26.1+ |
Query Examples
Section link for Query ExamplesThe following are examples of queries using FIND ALL.
Query: Find Documents Containing All Search Terms
Section link for Query: Find Documents Containing All Search TermsThe following query returns the latest version of all documents that contain both cdc and poutine (case insensitive):
SELECT id, name__v
FROM documents
FIND ALL ('cdc poutine')Response
Section link for Response{
"responseStatus": "SUCCESS",
"responseDetails": {
"find": "('cdc poutine')",
"pagesize": 1000,
"pageoffset": 0,
"size": 1,
"total": 1
},
"data": [
{
"id": 110,
"name__v": "CDC reports on poutine overconsumption"
}
]
}Query: Scope a FIND ALL Search to a Field
Section link for Query: Scope a FIND ALL Search to a FieldTo use FIND ALL within a certain field, use SCOPE {fields}:
SELECT id, name__v
FROM documents
FIND ALL ('cholesterol' SCOPE name__v)Query: Fuzzy Matching with DISTANCE
Section link for Query: Fuzzy Matching with DISTANCEUse DISTANCE with SCOPE {fields} to allow minor misspellings. The following query matches cholesterol despite the misspelled term:
SELECT id, name__v
FROM documents
FIND ALL ('cholestrol' DISTANCE [1] SCOPE name__v)