cancel
Showing results for 
Search instead for 
Did you mean: 

Search Query Nightmare

fandez
Champ in-the-making
Champ in-the-making
Hi everybody:
I'm trying to query my Alfresco 2.1.1 via web services (using windows and Tomcat). I use repositoryServiceSearch(String search) method, and the problem is that I'm not sure about the syntax of the query.

I have a folder with uuid "workspace://SpacesStore/83113447-d50c-11de-927f-2d995c94d18a" and inside I have a document named test.txt with "test test test" as the content inside. The user has all the permissions over the folder and the document.

When I "ask" for "test" I always have an empty QueryResult in return.

I have tried the following queries:

+PATH:"workspace://SpacesStore/83113447-d50c-11de-927f-2d995c94d18a" +TEXT:"test"
+PARENT:\"workspace://SpacesStore/83113447-d50c-11de-927f-2d995c94d18a\" +TEXT:\"test\"
+PATH:"workspace://SpacesStore/83113447-d50c-11de-927f-2d995c94d18a//*" + ( \\@\\{http://www.alfresco.org/model/content/1.0}name:test.txt)
+PATH:"workspace://SpacesStore/83113447-d50c-11de-927f-2d995c94d18a" +(@{http://www.alfresco.org/model/content/1.0}content:*test*  @{http://www.alfresco.org/model/content/1.0}name:*test*)

And a few more…
I'm kind of desperate, and that's why I beg your help
I know it should be a silly thing, but I don't find it
PLEASE HELP ME!
Regards

ps: here is my java generating the query (one of the versions I've made)

StringBuffer consulta = new StringBuffer();
consulta.append("+PATH:\"");
         if(group.isUser()){                  
            consulta.append("workspace://SpacesStore/"+aum.getAlfrescoFolderId());
         }else{
            consulta.append("workspace://SpacesStore/"+agm.getAlfrescoFolderId());
         }
         consulta.append("\"");         
         consulta.append(" +");
         consulta.append("(");
         consulta.append("@"+WSAlfresco.INFO_CONTENT+":*");
         consulta.append(keywords);
         consulta.append("*");
         consulta.append("  ");
         consulta.append("@"+WSAlfresco.INFO_NAME+":*");
         consulta.append(keywords);
         consulta.append("*");
         consulta.append(")");

         String query = consulta.toString();      
         result = wsAlfresco.repositoryServiceSearch(query);


result is ALWAYS NULL
2 REPLIES 2

mrogers
Star Contributor
Star Contributor
Does your search work through the UI?   Has your document been indexed correctly,

fandez
Champ in-the-making
Champ in-the-making
Does your search work through the UI?   Has your document been indexed correctly,
Um… it actually finds it, but only if I search by the name of the file, not the content. I had not try it through the Alfresco UI before.
How can I fix this? I mean, how can I force the system to index the documents and make them searchable by content?

Update:
Another thing I have discovered is that if I search content inside the files I have sent via web services it never finds it, but on the other hand it finds documents that were uploaded via the Alfresco UI…this makes me think that even if I'm sending the files correctly (they appear in Alfresco), the system is not indexing its content correctly. What am I doing wrong?

Thanks for your help