cancel
Showing results for 
Search instead for 
Did you mean: 

New store and root node

sergio
Champ in-the-making
Champ in-the-making
Another question about stores and root nodes.

Suppose I use WS APIs to create a new store with a given schema and address name. As known, a store contains at least a node, a root node. For example, the default SpacesStore store contains the root node app:company_home. Is a root node automatically created when creating a new store, or not? In this second case, does the creation of the root node follow the general rule for creating any other node? Then, how can I point to the new root node using Lucene?

Many thanks to all.

Cheers,

Sergio
2 REPLIES 2

doblek
Champ in-the-making
Champ in-the-making
Hi,

As far as I know, this root node is automatically created when the store is created (if store creation goes fine).

After you create a store:
Store store = WebServiceFactory.getRepositoryService().createStore(StoreEnum.workspace.toString(), store_name);

You can access its root node by:
Predicate predicate = new Predicate(null, store, null);
Node[] nodes_in_store = WebServiceFactory.getRepositoryService().get(predicate);

The root node is at index 0 in that array.

I don't know how to do this using Lucene… sorry.

Regards,
Enrique

sergio
Champ in-the-making
Champ in-the-making
Many thanks Enrique, very kind.

All the best,

Sergio