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 Moshe Recanati <mo...@kmslh.com> on 2014/06/23 10:46:49 UTC

How-to get results of comparison between documents

Hi,
I've several documents that describe mobile phone specification with index on release date.
Assume I want to query these documents and get the latest document based on release date.
Please describe how can I do it (if at all) and which query I need to execute


Regards,
Moshe Recanati
SVP Engineering
Office + 972-73-2617564
Mobile  + 972-52-6194481
Skype    :  recanati
[KMS2]<http://finance.yahoo.com/news/kms-lighthouse-named-gartner-cool-121000184.html>
more at  www.kmslh.com<http://www.kmslh.com/>


RE: How-to get results of comparison between documents

Posted by Moshe Recanati <mo...@kmslh.com>.
Got it thank you


Regards,
Moshe


-------- Original message --------
From: Shalin Shekhar Mangar
Date:06/23/2014 21:38 (GMT+02:00)
To: solr-user@lucene.apache.org
Subject: Re: How-to get results of comparison between documents

Hi Moshe,

The CollpasingQParser will group documents on a given field. In this case,
you can group by the mobile phone's id (which is unique across all mobile
phones) and then ask Solr to return the document with the maximum revision
value. That is exactly what Ludovic's example does.


On Mon, Jun 23, 2014 at 10:16 PM, Moshe Recanati <mo...@kmslh.com> wrote:

> Hi Ludvic,
> Thanks a lot.
> I looked into this reference guide and I would like to make sure I
> understand it correctly.
> Can you mention specific example on how to use it?
> It'll help me a lot.
>
>
> Regards,
> Moshe
>
>
> -------- Original message --------
> From: lboutros
> Date:06/23/2014 19:10 (GMT+02:00)
> To: solr-user@lucene.apache.org
> Subject: Re: How-to get results of comparison between documents
>
> Hi Moshe,
>
> If I understand correctly your needs, I think you want to use the
> CollapsingQParser post filter:
>
> https://cwiki.apache.org/confluence/pages/viewpage.action?pageId=40509582
>
> I think that, basically, adding this filter to your query should solve your
> problem:
>
> fq={!collapse field=document_id_field max=revision_field}
>
> Ludovic.
>
>
>
> -----
> Jouve
> France.
> --
> View this message in context:
> http://lucene.472066.n3.nabble.com/How-to-get-results-of-comparison-between-documents-tp4143389p4143458.html
> Sent from the Solr - User mailing list archive at Nabble.com.
>



--
Regards,
Shalin Shekhar Mangar.

Re: How-to get results of comparison between documents

Posted by Shalin Shekhar Mangar <sh...@gmail.com>.
Hi Moshe,

The CollpasingQParser will group documents on a given field. In this case,
you can group by the mobile phone's id (which is unique across all mobile
phones) and then ask Solr to return the document with the maximum revision
value. That is exactly what Ludovic's example does.


On Mon, Jun 23, 2014 at 10:16 PM, Moshe Recanati <mo...@kmslh.com> wrote:

> Hi Ludvic,
> Thanks a lot.
> I looked into this reference guide and I would like to make sure I
> understand it correctly.
> Can you mention specific example on how to use it?
> It'll help me a lot.
>
>
> Regards,
> Moshe
>
>
> -------- Original message --------
> From: lboutros
> Date:06/23/2014 19:10 (GMT+02:00)
> To: solr-user@lucene.apache.org
> Subject: Re: How-to get results of comparison between documents
>
> Hi Moshe,
>
> If I understand correctly your needs, I think you want to use the
> CollapsingQParser post filter:
>
> https://cwiki.apache.org/confluence/pages/viewpage.action?pageId=40509582
>
> I think that, basically, adding this filter to your query should solve your
> problem:
>
> fq={!collapse field=document_id_field max=revision_field}
>
> Ludovic.
>
>
>
> -----
> Jouve
> France.
> --
> View this message in context:
> http://lucene.472066.n3.nabble.com/How-to-get-results-of-comparison-between-documents-tp4143389p4143458.html
> Sent from the Solr - User mailing list archive at Nabble.com.
>



-- 
Regards,
Shalin Shekhar Mangar.

RE: How-to get results of comparison between documents

Posted by Moshe Recanati <mo...@kmslh.com>.
Hi Ludvic,
Thanks a lot.
I looked into this reference guide and I would like to make sure I understand it correctly.
Can you mention specific example on how to use it?
It'll help me a lot.


Regards,
Moshe


-------- Original message --------
From: lboutros
Date:06/23/2014 19:10 (GMT+02:00)
To: solr-user@lucene.apache.org
Subject: Re: How-to get results of comparison between documents

Hi Moshe,

If I understand correctly your needs, I think you want to use the
CollapsingQParser post filter:

https://cwiki.apache.org/confluence/pages/viewpage.action?pageId=40509582

I think that, basically, adding this filter to your query should solve your
problem:

fq={!collapse field=document_id_field max=revision_field}

Ludovic.



-----
Jouve
France.
--
View this message in context: http://lucene.472066.n3.nabble.com/How-to-get-results-of-comparison-between-documents-tp4143389p4143458.html
Sent from the Solr - User mailing list archive at Nabble.com.

Re: How-to get results of comparison between documents

Posted by lboutros <bo...@gmail.com>.
Hi Moshe,

If I understand correctly your needs, I think you want to use the
CollapsingQParser post filter:

https://cwiki.apache.org/confluence/pages/viewpage.action?pageId=40509582

I think that, basically, adding this filter to your query should solve your
problem:

fq={!collapse field=document_id_field max=revision_field} 

Ludovic.



-----
Jouve
France.
--
View this message in context: http://lucene.472066.n3.nabble.com/How-to-get-results-of-comparison-between-documents-tp4143389p4143458.html
Sent from the Solr - User mailing list archive at Nabble.com.