Indexing issue when trying to get a node name matching a value from JCR
I have the below query to get a image node from an instance over 1 million assets
type=dam:Asset
path=/content/dam/company/product-assets
nodename=test.tif
p.limit=-1
XPATH Query
/jcr:root/content/dam/company/product-assets//element(*, dam:Asset)
[
(fn:name() = 'test.tif')
]
SQL2
select [jcr:path], [jcr:score], * from [dam:Asset] as a where name(a) = 'test.tif' and isdescendantnode(a, '/content/dam/company/product-assets')
This gives me node traversal error. Can someone help me how I can recreate this query or how to index fn:name?
Below is what the oak generation tool gave definition for creating index and this is still in place But still it gives indexing error.

