cancel
Showing results for 
Search instead for 
Did you mean: 

Doubt about Lucene search terms and grouping of terms

damiar
Champ in-the-making
Champ in-the-making
Hi,

I'm trying to make a Lucene query and I'm using documentation provided by Lucene and Alfresco's wiki, but when I test my query in the node browser I always get all the nodes of the folder where I'm searching for.

Here is the query I'm using:

+PATH:"/app:company_home/cm:customPath/cm:customChild/cm:folder/*"
@cm\:name:"queryTerm" @cm\:title:"queryTerm" @cm\:description:"queryTerm"

(I've separated the query to make it more readable)

I want to search for the nodes contained in the given folder and matching any of the given fields. If no field matchs with 'queryTerm' the query must return an empty array.

I think the equivalent SQL code of the Lucene query that I want to make should look like this:

SELECT * FROM table WHERE path="path/to/folder" AND (field1 LIKE queryTerm OR field2 LIKE queryTerm OR field3 LIKE queryTerm …)

Any help?

Thanks!
2 REPLIES 2

mikeh
Star Contributor
Star Contributor
Try
+PATH:"/app:company_home/cm:customPath/cm:customChild/cm:folder/*"
+@cm\:name:"queryTerm" +@cm\:title:"queryTerm" +@cm\:description:"queryTerm"

Note the + signs.

Mike

damiar
Champ in-the-making
Champ in-the-making
I used this query and it has worked fine Smiley Happy


+PATH:"/app:company_home/cm:customNode/cm:customChild/cm:folder/*"
AND
(@cm\:name:"searchTerm" OR @cm\:title:"searchTerm")

Thanks for your help!