You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@solr.apache.org by krishna prasad <kr...@gmail.com> on 2021/10/15 04:30:28 UTC

Solr to get latest version of documents

I have a docs as follows:

{docid:1,version:1}
{docid:1,version:2}
{docid:2,version:1}
{docid:2,version:2}
{docid:2,version:3}
{docid:3,version:1}
{docid:3,version:2}


I need to get all the docs which are of the latest version per each docid.

o/p

{docid:1,version:2}
{docid:2,version:3}
{docid:3,version:2}

Can give some hints on how to do it.

Re: Solr to get latest version of documents

Posted by Joel Bernstein <jo...@gmail.com>.
Solr will overwrite the documents as they are indexed. So if they are
indexed in the order shown in your email you will get the correct versions.


Joel Bernstein
http://joelsolr.blogspot.com/


On Fri, Oct 15, 2021 at 1:02 AM krishna prasad <
krishna.kittugenious528@gmail.com> wrote:

> I have a docs as follows:
>
> {docid:1,version:1}
> {docid:1,version:2}
> {docid:2,version:1}
> {docid:2,version:2}
> {docid:2,version:3}
> {docid:3,version:1}
> {docid:3,version:2}
>
>
> I need to get all the docs which are of the latest version per each docid.
>
> o/p
>
> {docid:1,version:2}
> {docid:2,version:3}
> {docid:3,version:2}
>
> Can give some hints on how to do it.
>

Re: Solr to get latest version of documents

Posted by Vincenzo D'Amore <v....@gmail.com>.
Have a look at this

https://solr.apache.org/guide/8_9/updating-parts-of-documents.html#optimistic-concurrency


Ciao,
Vincenzo

--
mobile: 3498513251
skype: free.dev

> On 15 Oct 2021, at 07:01, krishna prasad <kr...@gmail.com> wrote:
> 
> I have a docs as follows:
> 
> {docid:1,version:1}
> {docid:1,version:2}
> {docid:2,version:1}
> {docid:2,version:2}
> {docid:2,version:3}
> {docid:3,version:1}
> {docid:3,version:2}
> 
> 
> I need to get all the docs which are of the latest version per each docid.
> 
> o/p
> 
> {docid:1,version:2}
> {docid:2,version:3}
> {docid:3,version:2}
> 
> Can give some hints on how to do it.