GraphQL sample for mixing faceted search with traditional key-value search
You can mix faceted search with traditional key-value search in the same query.
In the sample below, the
concept section, in the first "and" conjunct, performs a faceted search for Concepts with specific IDs or labels, while in the second "and" conjunct, a simple query for individual Tridion Sites items is performed. The entire query returns items that match both sets of criteria. Note that concept IDs are case-sensitive.
search {
criteria: {
groupBy: {
concept: {
connectorId: "poolparty"
conceptIds: ["https://myorg.com/MYORG2/290", "https://myorg.com/MYORG2/291"]
} or: {
concept: {
connectorId: "poolparty"
conceptLabels: ["My Product 1", "My Product 2"]
language: "english"
}
}
} and: {
groupBy: {
id: ["tcm:5-48", "tcm:5-49", "tcm:5-50"]
or: {
key: "namespace"
value: "tcm"
type: STRING
}
}
}
}
...
}