jpountz commented on PR #12374: URL: https://github.com/apache/lucene/pull/12374#issuecomment-1597335385
I'm not entirely happy with this new constructor either, because now there are two ways to customize slicing: either with this new constructor or by overriding the `slices()` method. I'd like to have a single one, and the approach to override a method to compute slices given a list of segments looks more user-friendly to me than having to compute slices up-front? For reference, this [20-years-old comment](https://github.com/apache/lucene/commit/360d91dde75244b3b73793ac3a2e6c8737c45f9f) on `IndexSearcher` about making sure to reuse `IndexSearcher` instances is outdated, all IndexSearcher constructors are cheap compared to the work that running any query would need to do. It's actually required to create a new `IndexSearcher` for every search if you wish to leverage `IndexSearcher`'s timeout support. If there is reluctance to computing slices on every call to `#search`, could we compute slices lazily and cache them in `getSlices()`? This way, it wouldn't be needed to increase the visibility of `slices` to `protected`? -- 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: issues-unsubscr...@lucene.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: issues-unsubscr...@lucene.apache.org For additional commands, e-mail: issues-h...@lucene.apache.org