cancel
Showing results for 
Search instead for 
Did you mean: 

Problem with Query

parlocchio
Champ in-the-making
Champ in-the-making
Hi,
I'm using Alfresco 1.2 and I'm trying to access alfresco from a JAVA application to get content, but I've some problem.

I'm trying to use WebServices implementation to access the repository and following your good examples on Wiki I've write this sample  code


    // Start the session
    AuthenticationUtils.startSession(USERNAME, PASSWORD);

        // Get a reference to the respository web service
        RepositoryServiceSoapBindingStub repositoryService = WebServiceFactory.getRepositoryService();        

        // Create a query object, looking for all items with alfresco in the name of text
        Query query = new Query(QueryLanguageEnum.lucene, "@cm\\:name:\"GEmap11\"");

…etc.

    // End the session
    AuthenticationUtils.endSession();

In my Alfresco repository there's is a content with filename GEmap11.pdf ( and no title and description properties set ); if I tried to search "GEmap11" on standard Web Client ( put the text on top-right box ) the file is correctly searched and show on the result.

If I try to access from my JAVA web Application with the code previous indicated no results are shown; the same null result has been returned if i try to search with this code:


       // Create a query object, looking for all items with alfresco in the name of text
        Query query = new Query(QueryLanguageEnum.lucene, "@cm\\:name:\"GEmap11*\"");

Only if I try to access with exactly filename the Lucene Query found my document


       // Create a query object, looking for all items with alfresco in the name of text
        Query query = new Query(QueryLanguageEnum.lucene, "@cm\\:name:\"GEmap11.pdf\"");

can someone help my to understand the problem ?

thanks in advance
6 REPLIES 6

jlbarrera
Champ in-the-making
Champ in-the-making
I'm using Alfresco 1.3 and i have the same problem..The query return NULL, and i following the examples of Alfresco wiki:

Finding nodes by text property values

To find all nodes with the cm:name property containing the word banana.

@cm\:title:"banana"

Note that lucene requires the : to be escaped using the \ character. You will have to escape the escape character in Java like "@cm\\:title:\"banana\""

darkhope
Champ in-the-making
Champ in-the-making
I have the same problem when I search text in a content.

Where did you find Alfresco 1.3 jlbarrera ?

jlbarrera
Champ in-the-making
Champ in-the-making
I download Alfresco from Subversion Repository.

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

mwick
Champ in-the-making
Champ in-the-making
Andy,

I really do not mean to be snarky, but if you look at what people are posting you will see that people are posting examples directly from the the link you posted. Examples, I would add, that are not working for me either.

Can you shed more light on the subject?

-Michael

parlocchio
Champ in-the-making
Champ in-the-making
infact….I've looked the Wiki example but I'm suspecting that sometingh else not works well

any help is appreciatied  Smiley Happy