Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Alfresco Solr Custom Search

Tags:

solr

alfresco

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".

like image 359
Massive Boisson Avatar asked Oct 08 '22 10:10

Massive Boisson


1 Answers

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.

like image 114
Jeff Potts Avatar answered Oct 12 '22 11:10

Jeff Potts