AnsweredAssumed Answered

Searching documents in alfresco

Question asked by pjain on Oct 2, 2007
Latest reply on Apr 13, 2009 by amit_wmw@yahoo.com
I am trying to search for documents with particular keyword. I tried xpath but it would search only in the document names and not content. I tried Lucene but it would just return the node path and not the actual documents that contain the keywords.
Following are the queries for both that I am using.

Workspace workspace = session.getWorkspace();
QueryManager queryManager = workspace.getQueryManager();
Query query = queryManager.createQuery("//app:company_home/m8:HomePage/*[contains('weather')]", Query.XPATH);


SearchParameters searchParameters = new SearchParameters();
          StoreRef storeRef = new StoreRef(StoreRef.PROTOCOL_WORKSPACE, "SpacesStore");
          searchParameters.addStore(storeRef);
          searchParameters.setLanguage(SearchService.LANGUAGE_LUCENE);
          
          String query = "PATH:\"/app:*/m8:*//*\" +TEXT:\"TWENTYFOURHRPRECIP\"";

Outcomes