in Alfresco

Alfresco Lucene tutorial

Alfresco has ability to contain information, documents and their metadata – we can say that holding data in structured and organized way is important but here is one thing that we can not live without and that is retrieving the information.

In this tutorial we are going to explain how to use lucene search and get nodes that you need in fast and easy.

In alfresco everything is a node, node can be of certain type, with aspects applied to it and can have number of properties. Nodes that have content are interesting too as we can search the content as well, limited to those nodes that can be converted to text.

Type Search

Syntax : TYPE:”{type name}”

Examples for searching folders


Property Search

Syntax: @{prefix}\:{property Name}:”Value to match”



Aspect Search

Syntax: ASPECT:”{aspect name}”



Text Search

Syntact: TEXT:”query”



Path Search

Using the path search we can search for for example all nodes that are childs direct or not to defined folder. Lets see few examples.

  • To select folder test that is under Company Home use:
  • All directly below folder test

  • All nodes below folder test on any depth
  • All nodes below folder test on any depth and include folder text

Search Combinations

This is great but it is not enough, we need search combinations. Node with certain type and name and so on.

Combinations are achieved using AND, OR and NOT keywords. Also there is a way for using ‘+’ and ‘-‘.

To match one or other

TEXT:"query"   @cm\:name:"Buy*
TEXT:"query" OR  @cm\:name:"Buy*

To match both

+TEXT:"query"   +@cm\:name:"Buy*
TEXT:"query" AND  @cm\:name:"Buy*

To match one attribute and not other

+ASPECT:"ab:invoice"  AND  -@cm\:description:"Buy*
ASPECT:"ab:invoice"  AND NOT -@cm\:description:"Buy*

To NOT match one criteria we can not put -@cm\:description:”Buy*, for this we must add one criteria to match and other not to match like so

 +TYPE:"sys:base"  -@cm\:description:"Buy*


We have shown how to use Lucene and query your nodes, for any questions let us know, we will be happy to help.







Don't be shellfish...Tweet about this on TwitterShare on LinkedInShare on Google+Share on RedditShare on Facebook

Leave a Reply to Alimiane Cancel reply