cancel
Showing results for 
Search instead for 
Did you mean: 

Problema con busqueda Alfresco

lourdes
Champ in-the-making
Champ in-the-making
Buenas, quiero una consulta que me diga si un fichero con nombre titulopdf, existe o no en  el directorio Obsoletos dentro del company_home:

Query query = new Query(Constants.QUERY_LANG_LUCENE, "PATH:\"//app:company_home/cmSmiley Surprisedbsoletos\" + @cm\\:title:"+ titulopdf);

El documento también existe dentro de company_home, y siempre me devuelve true aunque no esté dentro de obsoletos.

¿Qué puedo hacer?

query = new Query(Constants.QUERY_LANG_LUCENE, "PATH:\"//app:company_home/cmSmiley Surprisedbsoletos\" + @cm\\:title:"+ titulopdf);
                                                    
             // Execute the query
             QueryResult queryResult = repositoryService.query(STORE, query, false);
            
             // Display the results
             ResultSet resultSet = queryResult.getResultSet();
             ResultSetRow[] rows = resultSet.getRows();
             Predicate pred = new Predicate(null, STORE, query);
            
             boolean existedocumento=false;
             if (rows==null)
             {
               existedocumento=false;
               System.out.println("NO EXISTE");
               
             }
             else
             {
               existedocumento=true;
               System.out.println("EXISTE");
             }
1 REPLY 1

openpj
Elite Collaborator
Elite Collaborator
Try to update the Lucene query in this way:
query = new Query(Constants.QUERY_LANG_LUCENE, "PATH:\"/app:company_home/cm:Obsoletos/*\ AND @cm\\:title:\""+ titulopdf+\"");
Hope this helps.
Getting started

Tags


Find what you came for

We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.