lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kiwi clive <>
Subject Re: createJoinQuery use
Date Wed, 04 Apr 2012 17:37:31 GMT
Hi Martijn,

Thank you for responding so quickly. I found my reply was stuck in my drafts folder so apologies
for not getting back sooner.  I'm trying to search and join across two disparate document
types that have some common features. Your response confirms what I was looking into.

My understanding about the join query is that it does a 'search' for the from field and then
uses those results as part of the second or 'real' query. The first of these 'queries' I believe
is an internal mechanism that does not return docs, but smaller more efficient objects.

So if I wanted to search across two different types of document in one index with some fields
on one doc type and some on the other, I effectively need to perform 4 queries.

This is kind of where I was coming from.


 From: Martijn v Groningen <>
Sent: Thursday, March 29, 2012 3:23 PM
Subject: Re: createJoinQuery use
It is only possible to join on one side at the same time.
You mean something like this:
Query fromQuery = JoinUtil.createJoinQuery("from", "to", actualQuery,
Query toQuery = JoinUtil.createJoinQuery("to", "from", actualQuery,

And then use a boolean query to combine it? What is it you want to achieve?


On 29 March 2012 14:04, kiwi clive <> wrote:

> Hi Chaps,
> JoinUtil.createJoinQuery() specifies a Query for the from side of the join.
> Is it possible to query over both sides of the join (while still providing
> the two join fields) ? If not, what is the recommended best practice to do
> this?
> Thanks, and apologies for the dumb questions
> C

Met vriendelijke groet,

Martijn van Groningen
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message