nick-boss-tech commented on PR #4965: URL: https://github.com/apache/solr/pull/4965#issuecomment-5905092743
Note on scope, since this touches more than the embedded streaming path: The reported bug was that `EmbeddedSolrServer.queryAndStreamResponse` returned raw Lucene `IndexableField` values while `query` / `HttpSolrClient` returned native types. The cause is mechanical: the embedded streaming path overrides `JavaBinCodec.writeSolrDocument` to hand each doc straight to the callback, bypassing the `Resolver.resolve()` per-value conversion the normal JavaBin path applies. Fixing only the streaming path would have meant a second copy of the `getValue` mapping living in `EmbeddedSolrServer` to keep in sync. Instead, `externalizeStoredValues` is applied in `JavaBinResponseWriter.Resolver.writeResultsBody` — the one choke point both paths flow through (`EmbeddedSolrServer`'s streaming resolver calls the same inherited method). One conversion implementation, and every JavaBin consumer is guaranteed identical types. For existing consumers this is behavior-preserving: it is the same `DocsStreamer.getValue` mapping the old lazy path applied, just done eagerly. `TestJavaBinResponseWriter.testStoredFieldTypesInResponse` round-trips the normal JavaBin path and asserts the same types clients always saw. The single deliberate difference: a field whose conversion throws is now logged and omitted rather than passed through raw — raw `IndexableField`s were never consumable downstream (`JavaBinCodec` has no handling for them), and the method javadoc documents this. Explicitly out of scope: `convertLuceneDocToSolrDoc` and the JSON/XML writers still see stored fields as `IndexableField` — anything downstream depending on that is untouched. -- 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: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
