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 Aashish Agarwal <aa...@gmail.com> on 2018/01/19 03:52:07 UTC

Preserve order during indexing

Hi,

I need to index documents in solr so that they are stored in same order as
present in database. i.e *:* gives result in db order. Is it possible.

Thanks,
Aashish

Re: Preserve order during indexing

Posted by Mikhail Khludnev <mk...@apache.org>.
Alessandro,
Right. Solr's docnums are changed when segments merge and reordered.

On Wed, Jan 24, 2018 at 4:15 PM, alessandro.benedetti <a....@sease.io>
wrote:

> Hi Mikhail,
> but if he keeps the docs within a segment, the ordering may be correct just
> temporary right ?
> As soon as a segment merge happens ( for example after sequent indexing
> sessions or updates) the internal Lucene doc Id may change and the default
> order Solr side may change, right ?
> I am just asking as I never investigated what happens to Lucene internal
> Ids
> at merging time.
>
> Following the other comments I think a more robust approach would be to
> explicitly describe a sorting order and manage it through Solr sorting
> directly.
>
>
>
> -----
> ---------------
> Alessandro Benedetti
> Search Consultant, R&D Software Engineer, Director
> Sease Ltd. - www.sease.io
> --
> Sent from: http://lucene.472066.n3.nabble.com/Solr-User-f472068.html
>



-- 
Sincerely yours
Mikhail Khludnev

Re: Preserve order during indexing

Posted by "alessandro.benedetti" <a....@sease.io>.
Hi Mikhail,
but if he keeps the docs within a segment, the ordering may be correct just
temporary right ?
As soon as a segment merge happens ( for example after sequent indexing
sessions or updates) the internal Lucene doc Id may change and the default
order Solr side may change, right ?
I am just asking as I never investigated what happens to Lucene internal Ids
at merging time.

Following the other comments I think a more robust approach would be to
explicitly describe a sorting order and manage it through Solr sorting
directly.



-----
---------------
Alessandro Benedetti
Search Consultant, R&D Software Engineer, Director
Sease Ltd. - www.sease.io
--
Sent from: http://lucene.472066.n3.nabble.com/Solr-User-f472068.html

Re: Preserve order during indexing

Posted by Mikhail Khludnev <mk...@apache.org>.
Aashish, I believe you want to keep blocks in a segment boundaries.

On Fri, Jan 19, 2018 at 6:52 AM, Aashish Agarwal <aa...@gmail.com>
wrote:

> Hi,
>
> I need to index documents in solr so that they are stored in same order as
> present in database. i.e *:* gives result in db order. Is it possible.
>
> Thanks,
> Aashish
>



-- 
Sincerely yours
Mikhail Khludnev

Re: Preserve order during indexing

Posted by Webster Homer <we...@sial.com>.
db order isn't generally defined, unless you are using an explicit "order
by" on your select. Default behavior would vary by database type and even
release of the database. You can index the fields that you would "order by"
in the db, and sort on those fields in solr

On Thu, Jan 18, 2018 at 10:17 PM, jagdish vasani <ja...@gmail.com>
wrote:

> Hi Ashish,
> I think it's not possible,solr creates  inverted index.. but you can get
> documents by sorting orders, give sort=<indexfieldname> asc/desc.
>
> Thanks,
> JagdishVasani
> On 19-Jan-2018 9:22 am, "Aashish Agarwal" <aa...@gmail.com> wrote:
>
> > Hi,
> >
> > I need to index documents in solr so that they are stored in same order
> as
> > present in database. i.e *:* gives result in db order. Is it possible.
> >
> > Thanks,
> > Aashish
> >
>

-- 


This message and any attachment are confidential and may be privileged or 
otherwise protected from disclosure. If you are not the intended recipient, 
you must not copy this message or attachment or disclose the contents to 
any other person. If you have received this transmission in error, please 
notify the sender immediately and delete the message and any attachment 
from your system. Merck KGaA, Darmstadt, Germany and any of its 
subsidiaries do not accept liability for any omissions or errors in this 
message which may arise as a result of E-Mail-transmission or for damages 
resulting from any unauthorized changes of the content of this message and 
any attachment thereto. Merck KGaA, Darmstadt, Germany and any of its 
subsidiaries do not guarantee that this message is free of viruses and does 
not accept liability for any damages caused by any virus transmitted 
therewith.

Click http://www.emdgroup.com/disclaimer to access the German, French, 
Spanish and Portuguese versions of this disclaimer.

Re: Preserve order during indexing

Posted by jagdish vasani <ja...@gmail.com>.
Hi Ashish,
I think it's not possible,solr creates  inverted index.. but you can get
documents by sorting orders, give sort=<indexfieldname> asc/desc.

Thanks,
JagdishVasani
On 19-Jan-2018 9:22 am, "Aashish Agarwal" <aa...@gmail.com> wrote:

> Hi,
>
> I need to index documents in solr so that they are stored in same order as
> present in database. i.e *:* gives result in db order. Is it possible.
>
> Thanks,
> Aashish
>