You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lucene.apache.org by "Dan Ertman (JIRA)" <ji...@apache.org> on 2012/12/26 23:22:12 UTC

[jira] [Created] (SOLR-4235) Solr join or subquery should support sorting (and perhaps paging)

Dan Ertman created SOLR-4235:
--------------------------------

             Summary: Solr join or subquery should support sorting (and perhaps paging) 
                 Key: SOLR-4235
                 URL: https://issues.apache.org/jira/browse/SOLR-4235
             Project: Solr
          Issue Type: Improvement
    Affects Versions: 4.0
            Reporter: Dan Ertman


Suppose a list of product documents, and a list of order documents, in the same core.  We want to retrieve the products ordered. With the new join syntax,
q={!join from=orderSku to=sku}accountNumber=x

Great.  Now, we wish to retrieve the products most recently ordered, by order date.

q={!join from=orderSku to=sku}accountNumber=x&sort=orderDate desc 
Nope - product doesn't have an orderDate field, no effect

q={!join from=order to=sku)_query_:"accountNumber:x&sort=orderDate desc"
Nope. Parser approves it, but appears to have no effect. My guess is that sort is applied after the subquery result is effectively sent to the parent.

So we wind up getting all of the orders by date desc, and bundling up their SKUs, and POSTing that as a big OR clause. All things that join was supposed to save us from. It would be great if there was a way to support sort on the parent instead.

It would also be helpful if there was a way to support pagination of the parent.  For example, suppose I now want to display the date of the order along side the product. I can join from product to order, but if they've paged the search result I can't page the products used in the join.

I'd be perfectly content to use nested query syntax for both of these things - that might be more flexible overall - but it doesn't appear to work.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
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