nick-boss-tech commented on code in PR #4965:
URL: https://github.com/apache/solr/pull/4965#discussion_r4179926725
##########
solr/core/src/java/org/apache/solr/response/DocsStreamer.java:
##########
@@ -220,7 +234,12 @@ public static SolrDocument
externalizeStoredValues(SolrDocument doc, IndexSchema
private static Object externalizeValue(Object val, IndexSchema schema) {
if (val instanceof IndexableField f) {
- return getValue(schema.getFieldOrNull(f.name()), f);
+ try {
+ return getValue(schema.getFieldOrNull(f.name()), f);
+ } catch (Exception e) {
Review Comment:
🤖 *AI text below* 🤖 *(posted on behalf of Nick Shanin)*
Correction to my reply above: the schema-change story I told was wrong for
point fields. `IntPointField.toObject` and `DatePointField.toObject` do not
throw an exception for a stored value that predates a change to a point type;
they throw `AssertionError`, which the `catch (Exception e)` did not cover, so
the streamed response failed outright instead of omitting the value. I have
widened the catch in the streaming conversion to include `AssertionError`
(pushed in a8cf428f5b2) and added a test that streams a document whose pint
field holds a stored string: the value is now logged and omitted, and the rest
of the document is delivered. The new test also caught a second defect in the
same path: the omit step removed the field through the document's entry
iterator, which throws `UnsupportedOperationException`, so even a caught
conversion failure failed the response. The field is now removed from the
document directly, in the same commit.
One smaller correction in the same reply: on the serialized path the
Resolver does not quite "continue with the raw value". When conversion fails
there, the client receives a reflective rendering of the Lucene field object,
not the raw value itself. The wording above was imprecise on that point too.
--
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]