cancel
Showing results for 
Search instead for 
Did you mean: 

problems lucene query

alfredomuã_ozco
Champ in-the-making
Champ in-the-making
I have next repository structure:

–>/public
        –>/feeds
                –>doc1.txt("hello")
                –>prueba1(Carpeta)
                          –>doc2("hello")

I´d like to get all documents conteins hello text, in all subfolder of public.

usuario=cma.

public List<Document> findByTextInto(String spaceName, String searchValue,String usuario) throws GestorDocumentalException
{

List<Document> results =

new ArrayList<Document>();


try
{

RepositoryServiceSoapBindingStub repositoryService = WebServiceFactory.getRepositoryService();

String cadena=findPathUserHome(usuario);

cadena=formatearPath(cadena,spaceName);

//El valor de la cadena es: /app:company_home/app:user_homes/sys:cma/*[@cm:name = 'public']


Reference reference =

new Reference(STORE, null, cadena);
Predicate predicate =

new Predicate(new Reference[]{reference}, null, null);
Node[] nodes = repositoryService.get(predicate);



// Create a query object, looking for all items with alfresco in the name of text
Query query =

new Query(
Constants.

QUERY_LANG_LUCENE ,

"PATH:workspace://SpacesStore//app:company_home/app:user_homes/sys:cma/cmSmiley Tongueublic//* AND text:qwesdc");
error




 
Query query = new

Query(
Constants.

QUERY_LANG_LUCENE ,
"+PARENT:\"workspace://SpacesStore/"+ nodes.getReference().getUuid() + "\" +TEXT:\"" + searchValue + "\"");

Only get one document
4 REPLIES 4

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

PARENT is only the immediate parent.

You want a lucene query with the following


"PATH:\"/app:company_home/app:user_homes/sys:cma/cm:public//*\" AND text:\"qwesdc\""


The store is specified elsewhere on the search.

Andy

ponson
Champ in-the-making
Champ in-the-making
Hi Andy,

I am trying to retrive xml contents from web projects using web service.

When trying to execute the following query,

Store STORE = new Store("avm", "DmlTest");
String pathQuery="PATH:\"*\"";
Query queryCategory = new Query("lucene", pathQuery);
QueryResult queryResultCat = repositoryService.query(STORE, queryCategory, false);
….


I am getting the following result:

{http://www.alfresco.org/model/system/1.0}store-protocol : avm
{http://www.alfresco.org/model/content/1.0}modifier : admin
{http://www.alfresco.org/model/content/1.0}name : www
{http://www.alfresco.org/model/system/1.0}node-dbid : 2082
{http://www.alfresco.org/model/content/1.0}modified : 2007-09-14T12:07:04.232+05:30
{http://www.alfresco.org/model/content/1.0}owner : admin
{http://www.alfresco.org/model/content/1.0}created : 2007-09-14T12:07:04.232+05:30
{http://www.alfresco.org/model/system/1.0}store-identifier : DmlTest
{http://www.alfresco.org/model/system/1.0}node-uuid : UNKNOWN
{http://www.alfresco.org/model/content/1.0}creator : admin
{http://www.alfresco.org/model/content/1.0}path : /{http://www.alfresco.org/model/content/1.0}www


I wanted to search within this "cm:www" space. So i issued the following query.

String pathQuery="PATH:\"/cm:www/*\"";

This returns no result. Can you suggest me any ideas?
I am sure that i have another space called "cm:avm_webapps" under "cm:www".

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

Use the node browser in the admin console to check the path and the existance of the node.

The lucene search only goes against the latest snapshot of the staging area, or against the latest snapshot for a general avm store. It does not support layered querying (yet). If you are searching in a store and trying to find stuff in a store linked in below from another store, this will not work.

Andy

anndrewtr
Champ in-the-making
Champ in-the-making
Hi:
I am using Webservice api for search content in the Alfresco. I need to content only in the Candidate and the sub-folders. I have written the query as below. But it is not fetching any result.

Query query = new Query(
                        Constants.QUERY_LANG_LUCENE,
                        "PATH:\"/app:company_home/cm:data/cm:Test/cm:Candidate//*\" AND text:\"test\"");