How to handle huge amount of Content Fragments with GraphQL
We have following structure in our project
- /content/dam/customerA
- it contains 300k+ Content Fragments of type CFMofA
- GraphQL Endpoint customer-A
- /content/dam/customerB
- it contains 10 Content Fragments of type CFMofB
- GraphQL Endpoint customer-B
Now we try to send a GraphQL query like this to get a list of all Content Fragments of customer B to Endpoint B
query {
CFMofBList{
items {
...
}
}
}
But unfortunately we always run into this error:
SELECT asset.* FROM [dam:Asset] AS asset WHERE ISDESCENDANTNODE(asset, '/content/dam') AND asset.[jcr:content/contentFragment] = CAST('true' AS BOOLEAN) AND asset.[jcr:content/data/cq:model] = '/conf/customerB/settings/dam/cfm/models/CFMofB' ORDER BY asset.[jcr:path]
Explaining the query shows that this index is used "damAssetLucene(/oak:index/damAssetLucene)"
What can we do here? Best for us would be to restrict the path of the query to "/content/dam/customerB" but this is not supported by AEM as far as I know and the query is generated internally by the AEM GraphQL implementation. Increasing the read limit in org.apache.jackrabbit.oak.query.QueryEngineSettingsService did not help either.