laimis commented on code in PR #818: URL: https://github.com/apache/lucenenet/pull/818#discussion_r1167082303
########## src/Lucene.Net/Search/IndexSearcher.cs: ########## @@ -160,8 +160,18 @@ public IndexSearcher(IndexReaderContext context) /// Expert: Creates an array of leaf slices each holding a subset of the given leaves. /// Each <see cref="LeafSlice"/> is executed in a single thread. By default there /// will be one <see cref="LeafSlice"/> per leaf (<see cref="AtomicReaderContext"/>). + /// + /// NOTE: When overriding this method, be aware that the constructor of this class calls + /// a private method and not this virtual method. So if you need to override + /// the behavior during the initialization, call your own private method from the constructor + /// with whatever custom behavior you need. /// </summary> - protected virtual LeafSlice[] Slices(IList<AtomicReaderContext> leaves) + // LUCENENET specific - renamed to GetSlices to better indicate the purpose of this method + protected virtual LeafSlice[] GetSlices(IList<AtomicReaderContext> leaves) + => GetSlicesInternal(leaves); + + // LUCENENET specific - creating this so that we can call it from the constructor + protected LeafSlice[] GetSlicesInternal(IList<AtomicReaderContext> leaves) Review Comment: Great idea, made a new PR: https://github.com/apache/lucenenet/pull/837 -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: dev-unsubscr...@lucenenet.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org