cancel
Showing results for 
Search instead for 
Did you mean: 

Joined search queries, Lucene or SOLR

schipmolder
Champ on-the-rise
Champ on-the-rise
Hi,

Up to now I've been using lucene in java backed webscripts (alfresco community 4.0.d) to search for specific folders in the repository based on specific types and property values, that all works as expected.
Now my requirements have changed slightly and I need to do a joined query which will find the folder as before, but also all of it's (associated) children of a specific type or with specific properties.

I've been reading up on this quite a bit and understand that (correct me if I'm wrong) I'll need to use SOLR for these queries as Lucene can't do joins, is that correct?

When reading up on SOLR I found a lot of information on how to set it all up etc, but hardly any on the actual query syntax to perform these kind of queries.
Does anyone else have any experience with these or maybe a few pointers how i can achieve this?

Thanks
Skip
7 REPLIES 7

dantuffery
Champ in-the-making
Champ in-the-making
Hi

The version of Solr that Alfresco uses (1.4) doesn't support joins, the join functionality was released in Solr 4.

Dan

schipmolder
Champ on-the-rise
Champ on-the-rise
Ah ok, thanks Dan, that explains a lot.

Do you know if there's another way to run these kind of queries, perhaps using a different search engine?

I'm currently looping over the results of the main query and have to do another query for each one to get the children I want.
This works but is extremely slow when the resultset contains many items.

dantuffery
Champ in-the-making
Champ in-the-making
I wouldn't recommend using a different search engine.

There is nothing that will do what you want OOTB. Solr 4 is open source, have you had a look at how they implemented joins? It might give you some ideas.

andy
Champ on-the-rise
Champ on-the-rise
Hi

As I understand it, later versions of SOLR support joins defined at index time - and not ad hoc join support as you would expect from a DB.
There is an outline plan to suport this but it is currently a long way from the top of the list.


Andy

schipmolder
Champ on-the-rise
Champ on-the-rise
Hi,

Sorry for digging up an old thread but if i understand the release note of 5.0.b correctly then this should be the first version that comes with solr4. So, does that mean the join functionality that wasn't possible before is now part of alfresco?

And if so, does anyone have any pointers as to how to use these in a 5.0.c community deployment?

Thanks!

mrogers
Star Contributor
Star Contributor
No join is still not implemented.   But now that the move to solr 4 has been done my colleagues are now in a phase of making use of it.   I think the short term roadmap is faceted queries and exposing geo types and search highlight.

When I've discussed join queries with my colleagues the concern has always been yes we can do it.   But then performance will be a problem.

I'm sorry but I don't know specifics about the search roadmap.   It may not even exist yet since we are currently in project initiation phase.

Sorry I hadn't seen your comment, but thanks a lot for the information.

I'm in a bit of a pickle at the moment designing my models as ideally I'd make associations with child objects but I will need to be able to search for their properties so not sure what to do.

Maybe I should just make them all properties of the parent instead of children. The. I can always split them up later when solr4 does support te queries.

Anyway, thanks for your update!