AnsweredAssumed Answered

Searching Other Stores in Javascript

Question asked by vamirr on Oct 24, 2013
Latest reply on Oct 24, 2013 by vamirr
I seem to be having an issue searching for nodes in a newly created store.


I created a new store in java using:


        nodeService.createStore(StoreRef.PROTOCOL_WORKSPACE, "metricStore");



I then created a webscript to create and query nodes within this store.

In order to create nodes, I need a reference to the root node for the store.   I'm having a hard time getting that.


The lucene query below fails with the error: <strong>JavaException: org.alfresco.error.AlfrescoRuntimeException: 09240085 Failed to execute search: TYPE:"sys:store_root"</strong>


<javascript>
        var metricStoreNode = search.luceneSearch("workspace://metricStore", "TYPE:\"sys:store_root\"");

        if(metricStoreNode[0]){
                logger.log(metricStoreNode[0].nodeRef);
                logger.log(metricStoreNode[0].displayPath);
        }
        else
                logger.log("metricStore node not found");
</javascript>


Simply changing "workspace://metricStore" to "workspace://SpacesStore" and the luceneSearch properly finds the root node of SpacesStore.

What am I doing wrong here?   How else could/should I get the root node of this store.

Outcomes