5

using Alfresco 4.0.1 we have added numerous new entities and linked them to cm:content. When we search, we want to be able to search not only by criteria of content, but want to say give us all content that is linked to libraries with these properties (for examlpe).

We would expect we need to add a new Solr core (index) and populate it.

Has anyone done this? Can someone offer a hint or two, or a link to a post exlpaining it.

Thanks --MB

Addition 1: linked means the content is 'linked' with other entities using Alfresco's Peer (Non-Child) Associations.

Addition 2: for example if our model is content and libraries (but it's much more complicated then that), these are linked using peer (non-child) associations because we were not able to use parent-child for other reasons. So what we want to search for is all content with name "document", but that are linked to libreries with location "Texas".

Massive Boisson
  • 1,587
  • 6
  • 21
  • 28

1 Answers1

4

The bottom-line is that Alfresco isn't relational. You can set up associations and through the API you can ask a give node for its associations, but you cannot run queries across associations like you can when you do joins in a relational database.

Maybe you should add a location property to your content node and update its value with a behavior any time an association is created, updated, or deleted on that node. Then you'd be able to run a query by AND-ing the location with other criteria on the node.

Obviously, if you have many such properties that you need to keep in sync your behavior could start to affect performance negatively, but if you have only a handful you should be okay.

Jeff Potts
  • 10,328
  • 14
  • 38
  • Jeff, thanks. This is what we ended up doing, but somewhere deep inside I feel sad about it. We had the ambition to create a new solr index with our data, but it ended up being to tall of a montain to climb. – Massive Boisson Jun 28 '12 at 12:22