cancel
Showing results for 
Search instead for 
Did you mean: 

Is Lucene Query Support Sorting as CMIS Query?

ankit6190
Champ in-the-making
Champ in-the-making
Hello,
I want to retrieve all the document from alfresco using webservice  api…
I can retrieve all the document using following code

RepositoryServiceSoapBindingStub repositoryService = WebServiceFactory.getRepositoryService();        
       
        // Create a query object, looking for all items with alfresco in the name of text
        Query query = new Query(Constants.QUERY_LANG_LUCENE, "ALL :'Koala'");
       
        // Execute the query
        QueryResult queryResult = repositoryService.query(STORE, query, false);
       
        // Display the results
        ResultSet resultSet = queryResult.getResultSet();
       
But if i want to Retrieve Sorted Data using Lucene Query then ?
It is possible with Lucene ?
4 REPLIES 4

mitpatoliya
Star Collaborator
Star Collaborator
If I remember correctly there is Searchparameter  which  you can use along with the query to do such operations.

ankit6190
Champ in-the-making
Champ in-the-making
thanks of your reply,  mitpatoliya

but what i can do if i want to get this functionality through Web Service Api..
Because i cannot able to get  ServiceRegistry Object   through Web Service Api..

The code is below through which i apply sorting…

       
        SearchParameters sp = new SearchParameters();
        sp.addStore(getStoreRef());
        sp.setLanguage(SearchService.LANGUAGE_LUCENE);
        sp.setQuery("PATH:\"//.\"");
        sp.addSort("ID", true);
        ResultSet results = null;
        try
        {
            results = serviceRegistry.getSearchService().query(sp);
            for(ResultSetRow row : results)
            {
                NodeRef currentNodeRef = row.getNodeRef();
                …
            }
        }
        finally
        {
            if(results != null)
            {
                results.close();
            }
        }



In above ServiceRegistry  object is get through ApplicationContext and ApplicationContext is not accessible using Web Sevice Api

So Please Give some suggestion…

mitpatoliya
Star Collaborator
Star Collaborator
WebServiceFactory.getSearchService();

ankit6190
Champ in-the-making
Champ in-the-making
Thanks For Reply… mitpatoliya