lucene-solr-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Tomás Fernández Löbbe <tomasflo...@gmail.com>
Subject Re: Grouping results after Sorting or vice-versa
Date Thu, 29 Dec 2011 12:37:51 GMT
Hi Vijayaragavan, did you apply a patch for grouping in Solr 3.1? It is
available out of the box since 3.3.
Also, the result from grouping will not look exactly like you are
expecting, as results with the same value in the grouping field (in this
case, thread_id) will be collapsed into one group. You can get many
documents per group though (with group.limit) but the output will not be
like regular results.

Tomás

On Thu, Dec 29, 2011 at 3:38 AM, Vijayaragavan <ragavansvijay@gmail.com>wrote:

> Hi Juan,
>
> I'm using Solr 3.1
> The type of the date field is long.
> Let's say, the documents indexed in Solr server be..
>
> <doc>
> <str name="uniqueid">1326c5cc09bbc99a_1</str>
> <str name="threadid">1326c5cc09bbc99a</str>
> <long name="date">1316078009000</long>
> <...... Some Other fields here ......>
> <str name="subject">Some subject here...</str>
> <str name="message">Some message here...</str>
> </doc>
> <doc>
> <str name="uniqueid">1321dff33cecd5f4_1</str>
> <str name="threadid">1321dff33cecd5f4</str>
> <long name="date">1314956314000</long>
> <...... Some Other fields here ......>
> <str name="subject">Some subject here...</str>
> <str name="message">Some message here...</str>
> </doc>
> <doc>
> <str name="uniqueid">1321dff33cecd5f4_2</str>
> <str name="threadid">1321dff33cecd5f4</str>
> <long name="date">1317719220000</long>
> <...... Some Other fields here ......>
> <str name="subject">Some subject here...</str>
> <str name="message">Some message here...</str>
> </doc>
> </doc>
> <doc>
> <str name="uniqueid">133b70d0d0e32f12_1</str>
> <str name="threadid">133b70d0d0e32f12</str>
> <long name="date">1321626044000</long>
> <...... Some Other fields here ......>
> <str name="subject">Some subject here...</str>
> <str name="message">Some message here...</str>
> </doc>
>
> The results i'm getting for
>
> http://localhost:8080/solr/core1/select/?qt=nutch&q=*:*&fq=userid:333&group=true&group.field=threadid&group.sort=date%20desc&sort=date%20desc
>
> <doc>
> <str name="uniqueid">133b70d0d0e32f12_1</str>
> <str name="threadid">133b70d0d0e32f12</str>
> <long name="date">1321626044000</long>
> <...... Some Other fields here ......>
> <str name="subject">Some subject here...</str>
> <str name="message">Some message here...</str>
> </doc>
> <doc>
> <str name="uniqueid">1321dff33cecd5f4_2</str>
> <str name="threadid">1321dff33cecd5f4</str>
> <long name="date">1317719220000</long>
> <...... Some Other fields here ......>
> <str name="subject">Some subject here...</str>
> <str name="message">Some message here...</str>
> </doc>
> <doc>
> <str name="uniqueid">1326c5cc09bbc99a_1</str>
> <str name="threadid">1326c5cc09bbc99a</str>
> <long name="date">1316078009000</long>
> <...... Some Other fields here ......>
> <str name="subject">Some subject here...</str>
> <str name="message">Some message here...</str>
> </doc>
> <doc>
> <str name="uniqueid">1321dff33cecd5f4_1</str>
> <str name="threadid">1321dff33cecd5f4</str>
> <long name="date">1314956314000</long>
> <...... Some Other fields here ......>
> <str name="subject">Some subject here...</str>
> <str name="message">Some message here...</str>
> </doc>
>
> But the results i should get be...
> <doc>
> <str name="uniqueid">133b70d0d0e32f12_1</str>
> <str name="threadid">133b70d0d0e32f12</str>
> <long name="date">1321626044000</long>
> <...... Some Other fields here ......>
> <str name="subject">Some subject here...</str>
> <str name="message">Some message here...</str>
> </doc>
> <doc>
> <str name="uniqueid">1321dff33cecd5f4_2</str>
> <str name="threadid">1321dff33cecd5f4</str>
> <long name="date">1317719220000</long>
> <...... Some Other fields here ......>
> <str name="subject">Some subject here...</str>
> <str name="message">Some message here...</str>
> </doc>
> <doc>
> <doc>
> <str name="uniqueid">1321dff33cecd5f4_1</str>
> <str name="threadid">1321dff33cecd5f4</str>
> <long name="date">1314956314000</long>
> <...... Some Other fields here ......>
> <str name="subject">Some subject here...</str>
> <str name="message">Some message here...</str>
> </doc>
> <str name="uniqueid">1326c5cc09bbc99a_1</str>
> <str name="threadid">1326c5cc09bbc99a</str>
> <long name="date">1316078009000</long>
> <...... Some Other fields here ......>
> <str name="subject">Some subject here...</str>
> <str name="message">Some message here...</str>
> </doc>
>
> Is it possible to get such results? If yes, how?
>
> --
> View this message in context:
> http://lucene.472066.n3.nabble.com/Grouping-results-after-Sorting-or-vice-versa-tp3615957p3618172.html
> Sent from the Solr - User mailing list archive at Nabble.com.
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message