-
Notifications
You must be signed in to change notification settings - Fork 690
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
in tests replace deprecated IndexSearcher.doc() calls #3149
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In a number (all?) places here, you have a SolrIndexSearcher so could call getDocFetcher().doc(id)
which is the Solr way to do this, not calling storedFields()
. I leave it to you to contemplate which path makes the most sense based on the test. But I think the solr-way is preferred unless the test is particularly low-level (like "uninverting" package.
@@ -183,12 +183,12 @@ private void testRange(int precisionStep) throws Exception { | |||
ScoreDoc[] sd = topDocs.scoreDocs; | |||
assertNotNull(sd); | |||
assertEquals("Score doc count" + type, count, sd.length); | |||
Document doc = searcher.doc(sd[0].doc); | |||
Document doc = searcher.storedFields().document(sd[0].doc); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here we have an IndexSearcher
i.e. not a SolrIndexSearcher
and so not using SolrIndexSearcher.getDocFetcher()
here.
The API is deprecated since Lucene 9.5 - https://github.com/apache/lucene/blob/releases/lucene/9.5.0/lucene/core/src/java/org/apache/lucene/search/IndexSearcher.java#L382-L391 -- and remove in Lucene 10.
So the replacement here can go to both
main
andbranch_9x
branches with no JIRA or solr/CHANGES.txt entry needed in my opinion.