Advanced Search with searchCustom
The searchCustom filter provides advanced search capabilities with additional searchable fields and the ability to expand results to include related records.
Input Structure
The searchCustom filter accepts an INPUT_OBJECT with the following fields:
terms(String) - The search query to apply. All terms must match (case-insensitive AND logic). Multiple words can be quoted to search as a phrase.include([String]) - Additional field names to search beyond the default searchable fields. These fields are added to the search scope, not used to replace it.extend([String]) - Field names containing references to related records. When a record matches, related records referenced by these fields are also included in the results.
How it works
- Search Phase: The
termsare searched across default searchable fields PLUS any fields specified ininclude - Extension Phase: For each matching record, if
extendis provided, follow the field references to include related records in the results
Key behaviors
- All search terms must match (AND logic, case-insensitive)
includeadds to default fields; it does not restrict search to only those fieldsextenddoes not search additional fields; it expands the result set by following relationships- Both parameters are optional and can be used independently or together
Usage Patterns
Basic search
Searches default searchable fields:
query {
collectionViewConnection(
first: 10
searchCustom: {
terms: "red widget"
}
) {
edges {
node {
collectionId
}
}
}
}Include additional fields in search
query {
collectionViewConnection(
first: 10
searchCustom: {
terms: "acme"
include: ["customField1", "customField2"]
}
) {
edges {
node {
collectionId
}
}
}
}Expand results to include related records
query {
collectionViewConnection(
first: 10
searchCustom: {
terms: "urgent"
extend: ["relatedRecordUrl"]
}
) {
edges {
node {
collectionId
}
}
}
}Combine include and extend
query {
collectionViewConnection(
first: 10
searchCustom: {
terms: "acme corp"
include: ["customField1"]
extend: ["relatedRecordUrl"]
}
) {
edges {
node {
collectionId
}
}
}
}