Sridhar Raman wrote:
No, in my repository.xml file, SearchIndex is a direct child of Workspace element, not Repository element. Could that be the reason?
yes, that's definitively the reason. the SearchIndex child of the Workspace element is responsible for indexing workspace contents (everything except /jcr:system), while the SearchIndex child of the Repository element is responsible for indexing repository wide contents (everything under /jcr:system).
If the SearchIndex chlild of the Repository element is missing then the version storage is not indexed and a query will never return results from the version storage.
Just add a SearchIndex and the very end of your repository.xml and restart: <Repository> ...... <!-- Search index for content that is shared repository wide (/jcr:system tree, contains mainly versions) --> <SearchIndex class="org.apache.jackrabbit.core.query.lucene.SearchIndex"> <param name="path" value="${rep.home}/repository/index"/> </SearchIndex> </Repository> regards marcel