estimatedEntries showing 0 in Oak Lucene query plan despite result being found
Hi,
I have created a custom Lucene index in AEM (damAssetLucene-13-custom-1) and when I run a query, the execution plan shows estimatedEntries: 0 even though the query successfully returns 1 result.
Execution Plan:
[dam:Asset] as [dam:Asset] /* lucene:damAssetLucene-13-custom-1
indexDefinition: /oak:index/damAssetLucene-13-custom-1
estimatedEntries: 0
luceneQuery: +:ancestors:/content/dam +jcr:content/metadata/lob:lob:lls
propertyCondition: jcr:content/metadata/lob lob:lls */Execution Time:
- Total time: 1ms
- Number of nodes in result: 1
What I have tried:
- Reindexed the custom index (
@reindex = true) — still showsestimatedEntries: 0 - The correct index is being picked up by the query planner
- The query returns the correct result
My understanding from Oak docs: The Apache Jackrabbit Oak documentation states "For a unique index and 'x = 1' condition, the estimated number of entries is either 0 or 1 depending on whether the key is found."
Since the result is being found (1 node returned), I would expect estimatedEntries to be 1, not 0.
Questions:
- Why is
estimatedEntriesshowing0even though the key is found and result is returned? - Does
estimatedEntries: 0indicate any issue with my custom index definition? - Is there anything specific in the index definition (
propertyIndex=true,analyzed, etc.) that could cause this?
Any guidance would be appreciated.