AnsweredAssumed Answered

How to search the custom space using path query

Question asked by srinivasan on Jul 18, 2006
Latest reply on Aug 3, 2006 by andy
Hi Developers,

I have created the custom space in the company home, the space name is ECM, inside ECM i have two more custom space ECM1 and ECM2.

I found the sample code for search in the firstfoundationclient.java which is given below.

SearchService searchService = serviceRegistry.getSearchService();
        StoreRef storeRef = new StoreRef(StoreRef.PROTOCOL_WORKSPACE, "SpacesStore");
        ResultSet resultSet = searchService.query(storeRef, SearchService.LANGUAGE_LUCENE, "PATH:\"/app:company_home\"");        NodeRef companyHome = resultSet.getNodeRef(0);

here resultset size is 1

My code for search

SearchService searchService = serviceRegistry.getSearchService();
        StoreRef storeRef = new StoreRef(StoreRef.PROTOCOL_WORKSPACE, "SpacesStore");
        ResultSet resultSet = searchService.query(storeRef, SearchService.LANGUAGE_LUCENE, "PATH:\"/cm:ECM\"");
        //NodeRef companyHome = resultSet.getNodeRef(0);
        int size = resultSet.getChildAssocRefs().size();;
        System.out.println("size:"+size);

here resultset size is 0

but i have 2 subspaces under ECM Space.

In my query i gave the space name with case sensitive (i mean exact name like ECM not ecm). even though the result is zero.

Do you know why i am getting resultset size is 0 ?

or my search query is wrong?

Outcomes