cancel
Showing results for 
Search instead for 
Did you mean: 

Lucene search

pjain1
Champ in-the-making
Champ in-the-making
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\"";
1 REPLY 1

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

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\"";

Should work ….

Try
"TEXT:\"TWENTYFOURHRPRECIP\""
on its own, and
"PATH:\"/app:*/m8:*//*\"
on its own.

You query says the text match is required and the PATH optional (it will just improve the score)

Try
"+PATH:\"/app:company_home/m8:HomePage//*\" +TEXT:\"TWENTYFOURHRPRECIP\""

Your XPATH should also work - you may have meant  ……HomePage//*[……]


Andy
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.