solr
solr copied to clipboard
always(?) use SolrCore.getLatestSchema in RealTimeGetComponent
The RealTimeGetComponent uses getLatestSchema in 12 places and getSchema in 2 places.
Intuitively I would expect getSchema to be used throughout since it as per https://github.com/apache/solr/blob/releases/solr/9.0.0/solr/core/src/java/org/apache/solr/request/SolrQueryRequest.java#L86-L87 that is snapshot at request creation and so logically cannot change during processing. But based on 12:2 ratio perhaps getLatestSchema is equally suitable?
This pull request is to always use getLatestSchema or to add clarifying comments w.r.t. why some places use one API and others use the other in the component.
For code activated from a request, I think the code should use a consistent schema for that request. Thus I think RTG should be using req.getSchema() in those 10 places.
I noticed that SpellCheckComponent and QueryElevationComponent also use getLatestSchema... in fact, looking where getLatestSchema (92 times) versus getSchema (173 times) happens is an interesting mish mash of places.
Let's close this or fundamentally change it?