cancel
Showing results for 
Search instead for 
Did you mean: 

Problem searching via web-service-client

mistergerf
Champ in-the-making
Champ in-the-making
Here's my code:

         
AuthenticationUtils.startSession(credentials.getUsername(), credentials.getPassword());
Store store = new Store(StoreEnum.workspace, StoreName);
String queryString = "@cm\\{http\\://www.alfresco.org/1.0\\}name:\'conditioninspection*\"";
Query query = new Query(QueryLanguageEnum.lucene, queryString);
QueryResult queryResult = WebServiceFactory.getRepositoryService().query(store, query, true);
ResultSet rs = null;
ResultSetRow[] rows = null;
int rowCount = 0;
          
if (queryResult!=null)
{
   rs = queryResult.getResultSet();
   if (rs!=null)
         {
            rows = rs.getRows();
            if (rows!=null)
              rowCount = rows.length;
          }
}

‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍

I don't get any rows when I know there's a document with a name containing "conditioninspectkion".

Any ideas on what am I doing wrong ?
1 REPLY 1

andy
Champ on-the-rise
Champ on-the-rise
Hi

Wild cards are not supported in phrase queries (ones surrounded by "").

This is due to be added in 1.4.

You would have to use


String queryString = "@cm\\{http\\://www.alfresco.org/1.0\\}name:conditioninspection*";
‍‍‍

at the moment.

The wiki search page covers this.

http://wiki.alfresco.com/wiki/Search#Understanding_tokenisation

http://wiki.alfresco.com/wiki/Search#Finding_nodes_by_text_property_values


Regards

Andy