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 Rakhi Khatwani <rk...@gmail.com> on 2010/06/21 18:56:57 UTC

Alternative for field collapsing

Hi,
      I have an index with the following fields:
      id  (unique)
      title
      description
      price.

Suppose i want to find unique documents and count of all documents with the
same title, sorted on price.
How do i go about it.
Knowing that field collapsing is not stable with 1.4.
if i go about using facet's on id, it sorts either on id or on the count,
but not on the price,

Any Suggestions??
Regards,
Raakhi

Re: Alternative for field collapsing

Posted by Peter Karich <pe...@yahoo.de>.
Hi Raakhi,

yes, then the collapse patch works perfectly in our case. If you don't
get the patch applied correctly, try asking directly here:
https://issues.apache.org/jira/browse/SOLR-236

I did the same and got immediately response from Martin & Co or try the
latest patch:
2010-06-17 03:08 PM Martijn van Groningen

Querying is simple:
q=peter&collapse.field=title

and you will get back only one document for the same title containing
'peter' and
additionally the 'similar'/collapse-count for every document:
<lst name="collapse_counts">
  <str name="field">title</str>
  <lst name="results">
    <lst>
    <int name="collapseCount">4512</int>
    <int name="collapseCount">4010</int>
    ...

Regards,
Peter.

> Hi,
>         I wanted to apply field collapsing on the title(type string). but
> want to show only one document (and the count of such documents) per title
> rather than show all the documents.
>
> Regards
> Raakhi
>
>
> On Tue, Jun 22, 2010 at 12:59 AM, Peter Karich <pe...@yahoo.de> wrote:
>
>   
>> Hi Raakhi,
>>
>> First, field collapsing works pretty well in our system. And, as Martin
>> has said on 17.06.2010 in the other thread "Field Collapsing SOLR-236":
>>
>> I've added a new patch to the issue, so building the trunk (rev
>> 955615) with the latest patch should not be a problem. Due to recent
>> changes in the Lucene trunk the patch was not compatible.
>>
>> Second, if the id is unique applying field collapse make no sense. So I
>> suppose you will apply field collapsing to the title, right?
>> But in this case, why doesn't a simple query ala q=title:'my
>> title'&sort=price asc work for you? Or what do you want to achieve?
>> (The title should be of type string, I think)
>>
>> Regards,
>> Peter.
>>
>>     
>>> Hi,
>>>       I have an index with the following fields:
>>>       id  (unique)
>>>       title
>>>       description
>>>       price.
>>>
>>> Suppose i want to find unique documents and count of all documents with
>>>       
>> the
>>     
>>> same title, sorted on price.
>>> How do i go about it.
>>> Knowing that field collapsing is not stable with 1.4.
>>> if i go about using facet's on id, it sorts either on id or on the count,
>>> but not on the price,
>>>
>>> Any Suggestions??
>>> Regards,
>>> Raakhi
>>>
>>>
>>>       
>>
>>
>>     
>   


-- 
http://karussell.wordpress.com/


Re: Alternative for field collapsing

Posted by Rakhi Khatwani <rk...@gmail.com>.
Thanks Peter :)

On Tue, Jun 22, 2010 at 3:08 PM, Peter Karich <pe...@yahoo.de> wrote:

> ups, sorry. I meant Martijn! Not the germanized Martin :-/
>
> Peter.
>
> > Hi,
> >         I wanted to apply field collapsing on the title(type string). but
> > want to show only one document (and the count of such documents) per
> title
> > rather than show all the documents.
> >
> > Regards
> > Raakhi
> >
> >
> > On Tue, Jun 22, 2010 at 12:59 AM, Peter Karich <pe...@yahoo.de> wrote:
> >
> >
> >> Hi Raakhi,
> >>
> >> First, field collapsing works pretty well in our system. And, as Martin
> >> has said on 17.06.2010 in the other thread "Field Collapsing SOLR-236":
> >>
> >> I've added a new patch to the issue, so building the trunk (rev
> >> 955615) with the latest patch should not be a problem. Due to recent
> >> changes in the Lucene trunk the patch was not compatible.
> >>
> >> Second, if the id is unique applying field collapse make no sense. So I
> >> suppose you will apply field collapsing to the title, right?
> >> But in this case, why doesn't a simple query ala q=title:'my
> >> title'&sort=price asc work for you? Or what do you want to achieve?
> >> (The title should be of type string, I think)
> >>
> >> Regards,
> >> Peter.
> >>
> >>
> >>> Hi,
> >>>       I have an index with the following fields:
> >>>       id  (unique)
> >>>       title
> >>>       description
> >>>       price.
> >>>
> >>> Suppose i want to find unique documents and count of all documents with
> >>>
> >> the
> >>
> >>> same title, sorted on price.
> >>> How do i go about it.
> >>> Knowing that field collapsing is not stable with 1.4.
> >>> if i go about using facet's on id, it sorts either on id or on the
> count,
> >>> but not on the price,
> >>>
> >>> Any Suggestions??
> >>> Regards,
> >>> Raakhi
> >>>
> >>>
>
>

Re: Alternative for field collapsing

Posted by Peter Karich <pe...@yahoo.de>.
ups, sorry. I meant Martijn! Not the germanized Martin :-/

Peter.

> Hi,
>         I wanted to apply field collapsing on the title(type string). but
> want to show only one document (and the count of such documents) per title
> rather than show all the documents.
>
> Regards
> Raakhi
>
>
> On Tue, Jun 22, 2010 at 12:59 AM, Peter Karich <pe...@yahoo.de> wrote:
>
>   
>> Hi Raakhi,
>>
>> First, field collapsing works pretty well in our system. And, as Martin
>> has said on 17.06.2010 in the other thread "Field Collapsing SOLR-236":
>>
>> I've added a new patch to the issue, so building the trunk (rev
>> 955615) with the latest patch should not be a problem. Due to recent
>> changes in the Lucene trunk the patch was not compatible.
>>
>> Second, if the id is unique applying field collapse make no sense. So I
>> suppose you will apply field collapsing to the title, right?
>> But in this case, why doesn't a simple query ala q=title:'my
>> title'&sort=price asc work for you? Or what do you want to achieve?
>> (The title should be of type string, I think)
>>
>> Regards,
>> Peter.
>>
>>     
>>> Hi,
>>>       I have an index with the following fields:
>>>       id  (unique)
>>>       title
>>>       description
>>>       price.
>>>
>>> Suppose i want to find unique documents and count of all documents with
>>>       
>> the
>>     
>>> same title, sorted on price.
>>> How do i go about it.
>>> Knowing that field collapsing is not stable with 1.4.
>>> if i go about using facet's on id, it sorts either on id or on the count,
>>> but not on the price,
>>>
>>> Any Suggestions??
>>> Regards,
>>> Raakhi
>>>
>>>       


Re: Alternative for field collapsing

Posted by Rakhi Khatwani <rk...@gmail.com>.
Hi,
        I wanted to apply field collapsing on the title(type string). but
want to show only one document (and the count of such documents) per title
rather than show all the documents.

Regards
Raakhi


On Tue, Jun 22, 2010 at 12:59 AM, Peter Karich <pe...@yahoo.de> wrote:

> Hi Raakhi,
>
> First, field collapsing works pretty well in our system. And, as Martin
> has said on 17.06.2010 in the other thread "Field Collapsing SOLR-236":
>
> I've added a new patch to the issue, so building the trunk (rev
> 955615) with the latest patch should not be a problem. Due to recent
> changes in the Lucene trunk the patch was not compatible.
>
> Second, if the id is unique applying field collapse make no sense. So I
> suppose you will apply field collapsing to the title, right?
> But in this case, why doesn't a simple query ala q=title:'my
> title'&sort=price asc work for you? Or what do you want to achieve?
> (The title should be of type string, I think)
>
> Regards,
> Peter.
>
> > Hi,
> >       I have an index with the following fields:
> >       id  (unique)
> >       title
> >       description
> >       price.
> >
> > Suppose i want to find unique documents and count of all documents with
> the
> > same title, sorted on price.
> > How do i go about it.
> > Knowing that field collapsing is not stable with 1.4.
> > if i go about using facet's on id, it sorts either on id or on the count,
> > but not on the price,
> >
> > Any Suggestions??
> > Regards,
> > Raakhi
> >
> >
>
>
>

Re: Alternative for field collapsing

Posted by Peter Karich <pe...@yahoo.de>.
Hi Raakhi,

First, field collapsing works pretty well in our system. And, as Martin
has said on 17.06.2010 in the other thread "Field Collapsing SOLR-236":

I've added a new patch to the issue, so building the trunk (rev
955615) with the latest patch should not be a problem. Due to recent
changes in the Lucene trunk the patch was not compatible.

Second, if the id is unique applying field collapse make no sense. So I
suppose you will apply field collapsing to the title, right?
But in this case, why doesn't a simple query ala q=title:'my
title'&sort=price asc work for you? Or what do you want to achieve?
(The title should be of type string, I think)

Regards,
Peter.

> Hi,
>       I have an index with the following fields:
>       id  (unique)
>       title
>       description
>       price.
>
> Suppose i want to find unique documents and count of all documents with the
> same title, sorted on price.
> How do i go about it.
> Knowing that field collapsing is not stable with 1.4.
> if i go about using facet's on id, it sorts either on id or on the count,
> but not on the price,
>
> Any Suggestions??
> Regards,
> Raakhi
>
>