Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is it possible to make Lucene queries in alfresco that find nodes based on their parent/children properties

is it possible to make Lucene query in alfresco that finds nodes based on their parent/children properties? For example i want to find all the nodes that have the property "foo" set to '1' and have nodes associated to them by a child association with the property "baz" set to '2' (maybe specifing somehow the name of their child association)

something like

@crl\:numeroAtto:"6555" AND @crl\:firmatario:"Marco rossi"

Where "numeroAtto" is a property of the parent node and "firmatario" is a property of the child. The association type is "firmatari" (It's not in the query because i don't know how to use it)

To be even clearer i'm trying to tell lucene: "Find all nodes that have the property numeroAtto set to 6555 and that have children (association type with the children: firmatari) with the property "firmatario" set to Marco rossi.

Thanx in advance

like image 647
Nicola Peluchetti Avatar asked Jan 21 '23 13:01

Nicola Peluchetti


1 Answers

You can't search on associations, so what we do is not to build slow queries. But add a new d:text property of the association on the parent Type.

So it's searchable through Lucune. To make it fully working, create a Java Behaviour which checks on content update. And when 'your' association is found it adds it to the d:text property.

This way lucene searches are very quick.

like image 187
Tahir Malik Avatar answered May 11 '23 09:05

Tahir Malik