Skip to content

Apache Lucene open-source search software

Adjust Lucene version value to be a String rather than an numeric. I found a case with Ruby where the numeric was too big to laod when serialiized to a YAML file (maybe this is an edge case?). It is unlikely that a client needs to use this as a numeric anyway, but rather as a comparison against later calls to the IndexInfoRequestHandler.

Erik Hatcherea7d51090176
diff --git a/src/java/org/apache/solr/handler/IndexInfoRequestHandler.java b/src/java/org/apache/solr/handler/IndexInfoRequestHandler.java
index 87483571440..b7fd5c987ca 100644
--- a/src/java/org/apache/solr/handler/IndexInfoRequestHandler.java
+++ b/src/java/org/apache/solr/handler/IndexInfoRequestHandler.java
@@ -58,10 +58,10 @@ public class IndexInfoRequestHandler extends RequestHandlerBase {
}
rsp.add("fields", fields);
- Map<String,Number> indexInfo = new HashMap<String,Number>();
+ Map<String,Object> indexInfo = new HashMap<String,Object>();
indexInfo.put("numDocs", reader.numDocs());
indexInfo.put("maxDoc", reader.maxDoc());
- indexInfo.put("version", reader.getVersion());
+ indexInfo.put("version", Long.toString(reader.getVersion()));
// indexInfo.put("age", ); // computed from SolrIndexSearcher.openedAt?
rsp.add("index", indexInfo);