You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@solr.apache.org by GitBox <gi...@apache.org> on 2022/10/31 16:12:25 UTC

[GitHub] [solr] HoustonPutman commented on a diff in pull request #913: SOLR-16260: Add support for Instant, LocalDate and ZonedDateTime to JavaBinCodec

HoustonPutman commented on code in PR #913:
URL: https://github.com/apache/solr/pull/913#discussion_r1009603642


##########
solr/solrj/src/java/org/apache/solr/common/util/JavaBinCodec.java:
##########
@@ -1080,6 +1083,15 @@ public boolean writePrimitive(Object val) throws IOException {
       daos.writeByte(DATE);
       daos.writeLong(((Date) val).getTime());
       return true;
+    } else if (val instanceof Instant) {
+      daos.writeByte(DATE);
+      daos.writeLong(((Instant) val).toEpochMilli());
+    } else if (val instanceof LocalDate) {
+      daos.writeByte(DATE);
+      daos.writeLong(((LocalDate) val).toEpochDay());

Review Comment:
   Honestly I think it's better to use Date than String. Will probably revert those changes before moving forward. We would prefer this to work out of the box for most people without them having to add an UpdateProcessorFactory.
   
   



-- 
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-unsubscribe@solr.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@solr.apache.org
For additional commands, e-mail: issues-help@solr.apache.org