Is it possible to make Lucene queries in the outside world that find nodes based on their parent / child properties

Is it possible to make a Lucene query in a tooltip that finds nodes based on their parent / child properties? For example, I want to find all nodes whose property β€œfoo” is set to β€œ1”, and to have nodes associated with them by a child association, with property β€œbaz” set to β€œ2” (perhaps the name is somehow specified their affiliated association)

sort of

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

Where "numeroAtto" is the property of the parent node, and "firmatario" is the property of the child. The association type is firmatari (this is not in the request because I don’t know how to use it)

To be clearer, I try to tell lucene: "Find all nodes that have the numeroAtto property set to 6555 and that have children (type of association with children: firmatari) with the" firmatario "property set by Marco rossi.

Thanx in advance

+4
source share
2 answers

There is no direct direct way to do this.

Another idea: the first will return all the parent nodes, and then build a search based on the root of each returned node.

+4
source

You cannot search in associations, therefore we do not create slow queries. But add a new d: text property for the association in the parent type.

Thus, it is searchable through Lucune. To make it fully work, create a Java behavior that checks for content updates. And when your "association" is found, it adds it to the d: text property.

Thus, lucene searches are very fast.

+5
source

Source: https://habr.com/ru/post/1338754/


All Articles