djkevincr commented on a change in pull request #158: GORA-555: Improve Lucene 
query implementation with NumericRangeQuery
URL: https://github.com/apache/gora/pull/158#discussion_r272787651
 
 

 ##########
 File path: 
gora-lucene/src/main/java/org/apache/gora/lucene/store/LuceneStore.java
 ##########
 @@ -545,7 +546,17 @@ public void put(K key, T persistent) {
     }
     LOG.info("DOCUMENT: {}", doc);
     try {
-      doc.add(new StringField(mapping.getPrimaryKey(), key.toString(), 
Store.YES));
+      if (key instanceof Integer) {
+        doc.add(new IntPoint(mapping.getPrimaryKey(), ((Integer) 
key).intValue()));
 
 Review comment:
   You could use auto unboxing -  wrapper class to the primitive class
   new IntPoint(mapping.getPrimaryKey(), ((Integer) key).intValue()) ===
   new IntPoint(mapping.getPrimaryKey(), (Integer) key) 

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

Reply via email to