cancel
Showing results for 
Search instead for 
Did you mean: 

Lucene/XPath query for associations

webdesigner
Champ in-the-making
Champ in-the-making
Hi All,

Is it possible to search obejcts by proeprties of the associated objects?

1) I have an aspect that has an association to the object of my custom type.
2) This custom type has a boolean property.
3) I add this aspect to a folder.

4) No I want to query (with Lucene or XPath) for folders wich have this aspect AND the objects associated by this aspect must have "true" in a boolean property.

Is it possible? If not what I can do to perform search by properties of the associated objects?

Thank in advance
Best regards
6 REPLIES 6

rivarola
Champ on-the-rise
Champ on-the-rise
Hello,

The search API does not support associations at the moment   Smiley Sad
You may do it using two consecutive queries…

santigt
Champ in-the-making
Champ in-the-making
Hi everybody!!

How can I search nodes with specific associated nodes using two consecutive queries on Alfresco Webscripts 2.1???

I usually use one query and then a filter (post-processing) in JavaScript, selecting only the nodes that have associated the nodes I want. The problem here is the limit search, because it's possible to obtain 1000 nodes from a search, and no one has association with the nodes I want.

Can anyone help me??? Thanks a lot!!

Regards,


Santigt

kevinr
Star Contributor
Star Contributor
It may be possible/better to constrain your initial query if possible. Have you seen the ASSOCTYPEQNAME, PRIMARYASSOCIATIONTYPEQNAME and PATH operators on the search API page?
http://wiki.alfresco.com/wiki/Search

Thanks,

Kevin

rivarola
Champ on-the-rise
Champ on-the-rise
Hello Kevin,

You mean we should use child associations in the model whenever possible (like for multilingual documents) so as to use the ASSOCTYPEQNAME or PRIMARYASSOCIATIONTYPEQNAME features ?
These search options only work for child associations, don't they ?

kevinr
Star Contributor
Star Contributor
It depends on your model - if the parent object "owns" the child object and the child should be deleted when the parent is then the answer is Yes - otherwise standard associations are correct. Unfortunately yes those operators only work for child assocs.

Thanks,

Kevin

rleones
Champ in-the-making
Champ in-the-making
Are this feature provided in the current version of Alfresco? Will it be provided anytime?