You are viewing a plain text version of this content. The canonical link for it is here.
Posted to solr-user@lucene.apache.org by Kashif Khan <up...@gmail.com> on 2012/02/08 16:34:16 UTC

Sorting solrdocumentlist object after querying

Hi all,

I want to sort a SolrDocumentList after it has been queried and obtained
from the QueryResponse.getResults(). The reason is i have a SolrDocumentList
obtained after querying using QueryResponse.getResults() and i have added
few docs to it. Now i want to sort this SolrDocumentList based on the same
fields i did the querying before i modified this SolrDocumentList.

Please advice any alternatives with sample code will be appreciated a lot if
this is not possible. It is an emergency



--
View this message in context: http://lucene.472066.n3.nabble.com/Sorting-solrdocumentlist-object-after-querying-tp3726303p3726303.html
Sent from the Solr - User mailing list archive at Nabble.com.

Re: Sorting solrdocumentlist object after querying

Posted by Kashif Khan <up...@gmail.com>.
hey Tommaso,

That result grouping is during the query but i want to sort the
solrdocumentlist after it has been queried and i hv injected few solrdocs in
the solrdocumentlist. Thus i want this solrdocumentlist to be sorted based
on the fields i specify and cannot query the solr for result grouping cos
those injected documents are not available in that solr also that result
grouping is not working with multiple shards

--
View this message in context: http://lucene.472066.n3.nabble.com/Sorting-solrdocumentlist-object-after-querying-tp3726303p3732120.html
Sent from the Solr - User mailing list archive at Nabble.com.

Re: Sorting solrdocumentlist object after querying

Posted by Tommaso Teofili <to...@gmail.com>.
Hi Kashif,
maybe the field collapsing feature [1] may help you with your requirement.
Hope this helps,
Tommaso

[1] :  http://wiki.apache.org/solr/FieldCollapsing

Re: Sorting solrdocumentlist object after querying

Posted by Kashif Khan <up...@gmail.com>.
No that sorting is based on multiple fields. Basically i want to sort them
as the group by statement like in the SQL based on few fields and many
loops to go through. The problem is that i have say 1,000,000 solr docs
after injecting my few solr docs and then i want to do group by these solr
docs by some fields and then take 20 records for paging. So i need some
shortcut for that.
--
Kashif Khan.
http://www.kashifkhan.in



On Wed, Feb 8, 2012 at 11:07 PM, iorixxx [via Lucene] <
ml-node+s472066n3726788h81@n3.nabble.com> wrote:

> > I want to sort a SolrDocumentList after it has been queried
> > and obtained
> > from the QueryResponse.getResults(). The reason is i have a
> > SolrDocumentList
> > obtained after querying using QueryResponse.getResults() and
> > i have added
> > few docs to it. Now i want to sort this SolrDocumentList
> > based on the same
> > fields i did the querying before i modified this
> > SolrDocumentList.
>
> QueryResponse.getResults()  will return rows many documents. Cant you sort
> them (plus your injected documents) with your own?
>
>
> ------------------------------
>  If you reply to this email, your message will be added to the discussion
> below:
>
> http://lucene.472066.n3.nabble.com/Sorting-solrdocumentlist-object-after-querying-tp3726303p3726788.html
>  To unsubscribe from Sorting solrdocumentlist object after querying, click
> here<http://lucene.472066.n3.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=3726303&code=dXBsaW5rMjAxMEBnbWFpbC5jb218MzcyNjMwM3wtMTgzODU3NDI3OQ==>
> .
> NAML<http://lucene.472066.n3.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml>
>


--
View this message in context: http://lucene.472066.n3.nabble.com/Sorting-solrdocumentlist-object-after-querying-tp3726303p3728549.html
Sent from the Solr - User mailing list archive at Nabble.com.

Re: Sorting solrdocumentlist object after querying

Posted by Ahmet Arslan <io...@yahoo.com>.
> I want to sort a SolrDocumentList after it has been queried
> and obtained
> from the QueryResponse.getResults(). The reason is i have a
> SolrDocumentList
> obtained after querying using QueryResponse.getResults() and
> i have added
> few docs to it. Now i want to sort this SolrDocumentList
> based on the same
> fields i did the querying before i modified this
> SolrDocumentList.

QueryResponse.getResults()  will return rows many documents. Cant you sort them (plus your injected documents) with your own?