cancel
Showing results for 
Search instead for 
Did you mean: 

Lucene combined query on TITLE and TEXT

bindiya
Champ in-the-making
Champ in-the-making
Hi

I use following query to search content for their TITLE as well as TEXT in the document. But this returns result only contents and files with the search on TITLE, it ignores TEXT search.
Is anything wrong with my query?

StringBuffer sb = new StringBuffer();
sb.append("TYPE:\"{").append(NamespaceService.CONTENT_MODEL_1_0_URI).append("}content\" ") ;
sb.append("+@").append(NamespaceService.CONTENT_MODEL_PREFIX).append("\\:title:"test" TEXT:"test");

Query query = new Query(Constants.QUERY_LANG_LUCENE, sb.toString());

Thanks
Bindiya
4 REPLIES 4

bindiya
Champ in-the-making
Champ in-the-making
Can anyone help me with this??

Thanks,
Bindiya

cludt
Champ in-the-making
Champ in-the-making
Hi Bindiya,

I guess you missed the parenthesis around your query; it should look like this

(@ […] title:test* TEXT:test*)

Best regards
  Christian

putodemonio
Champ in-the-making
Champ in-the-making
In wich package is NamespaceService?? isn't it in org.alfresco.service.namespace??
How can I use it if I'm programing a Web Service Client??

cludt
Champ in-the-making
Champ in-the-making
As far as I know (and see), there is no NamespaceService, you'd have to create it.