RE: LeafReaderContext ord is unexpectedly 0

2020-12-27 Thread Uwe Schindler
Hi, just to add: Any public query API (weight, query, DocIdSetIterators,…) should always take LeafReaderContext as parameter. If you have some solr plugin that maybe implements some method only taking LeafReader, this one lost context and it’s impossible to restore from that. So if sending

Re: LeafReaderContext ord is unexpectedly 0

2020-12-27 Thread Joel Bernstein
Ok this makes sense. I suspect I never ran across this before because I always accessed the ord through the context before getting the reader. Joel Bernstein http://joelsolr.blogspot.com/ On Sun, Dec 27, 2020 at 1:10 PM Uwe Schindler wrote: > Hi, > > > > that behaviour is fully correct and

RE: LeafReaderContext ord is unexpectedly 0

2020-12-27 Thread Uwe Schindler
Hi, that behaviour is fully correct and was always like that. Just for info (I had some slides on berlinbuzzwords like 8.5 years ago): https://youtu.be/iZZ1AbJ6dik?t=1975 The problem is a classical “wrong point of view” problem! IndexReaders and their subclasses have no idea about

Re: LeafReaderContext ord is unexpectedly 0

2020-12-27 Thread Joel Bernstein
I'll have to dig around in some collector code. I could swear that you could track the ord of the leaf this way at collection time. But there may be different code paths used then one I showed above. Joel Bernstein http://joelsolr.blogspot.com/ On Sun, Dec 27, 2020 at 12:25 PM Haoyu Zhai

Re: LeafReaderContext ord is unexpectedly 0

2020-12-27 Thread Haoyu Zhai
Hi Joel, LeafReader.getContext() is expected to return "the root IndexReaderContext for this IndexReader 's sub-reader

LeafReaderContext ord is unexpectedly 0

2020-12-27 Thread Joel Bernstein
I ran into this while writing some Solr code today. List leaves = req.getSearcher().getTopReaderContext().leaves(); The req is a SolrQueryRequest object. Now if I do this: leaves.get(5).reader().getContext().ord I would expect *ord* in this scenario to be *5*. But in my testing in master