You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lucene.apache.org by "Martijn van Groningen (Issue Comment Edited) (JIRA)" <ji...@apache.org> on 2011/11/29 07:57:40 UTC

[jira] [Issue Comment Edited] (LUCENE-3602) Add join query to Lucene

    [ https://issues.apache.org/jira/browse/LUCENE-3602?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13159124#comment-13159124 ] 

Martijn van Groningen edited comment on LUCENE-3602 at 11/29/11 6:56 AM:
-------------------------------------------------------------------------

I'll remove the builder api. This was just my sugar api. I'll change that in a constructor where the toSearcher and preComputedFromDocs are optional.

bq. How does the preComputedFromDocs work? It's not per-segment? Like it's a bitset across entire toplevel doc space?
Yes, it is a bitset across all segments, so toplevel. The whole query implementation is top level. People can use this the execute the real query outside the JoinQuery (if this isn't specified the query is executed when the Weight is created for the JoinQuery). I think this would be nice if people want the for example cache the encapsulated query.

bq. I wonder if we can make this work per-segment... but that can be a 2nd phase.
I thought about that. But this would mean we need to execute the join query in two phases. The first phase would collect all the "from" values from the documents matching the encapsulated query. The second phase would match the documents that have matching on the "to" side with the "from" values collected in the first phase. The will work per segment and I think would also make the JoinQuery work in distributed environment. We can do this in a second development phase.

bq. I think you can use seekExact instead of seekCeil? Better performance...
I'll change that.

bq. What is the AdjustedDISI for (and when would Weight.scorer get a top-level context...)? 
Actually that is only used to map top level docids to segment docids (Basically doing: toplevel_docid - base). This is necessary because Weight.scorer works per segment and the query implementation not.
                
      was (Author: martijn.v.groningen):
    I'll remove the builder api. This was just my sugar api. I'll change that in a constructor where the toSearcher and preComputedFromDocs are optional.

bq. How does the preComputedFromDocs work? It's not per-segment? Like it's a bitset across entire toplevel doc space?
Yes, it is a bitset across all segments, so toplevel. The whole query implementation is top level. People can use this the execute the real query outside the JoinQuery (if this isn't specified the query is executed when the Weight is created for the JoinQuery). I think this would be nice if people want the for example cache the encapsulated query.

I wonder if we can make this work per-segment... but that can be a 2nd phase.
I thought about that. But this would mean we need to execute the join query in two phases. The first phase would collect all the "from" values from the documents matching the encapsulated query. The second phase would match the documents that have matching on the "to" side with the "from" values collected in the first phase. The will work per segment and I think would also make the JoinQuery work in distributed environment. We can do this in a second development phase.

I think you can use seekExact instead of seekCeil? Better performance...
I'll change that.

What is the AdjustedDISI for (and when would Weight.scorer get a top-level context...)? Actually that is only used to map top level docids to segment docids (Basically doing: toplevel_docid - base). This is necessary because Weight.scorer works per segment and the query implementation not.
                  
> Add join query to Lucene
> ------------------------
>
>                 Key: LUCENE-3602
>                 URL: https://issues.apache.org/jira/browse/LUCENE-3602
>             Project: Lucene - Java
>          Issue Type: New Feature
>          Components: modules/join
>            Reporter: Martijn van Groningen
>         Attachments: LUCENE-3602.patch
>
>
> Solr has (psuedo) join query for a while now. I think this should also be available in Lucene.  

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org