lucene-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From a.@apache.org
Subject [25/32] lucene-solr:jira/solr-10247: SOLR-10247 Fix compact conversion to Solr document.
Date Tue, 14 Mar 2017 09:21:03 GMT
SOLR-10247 Fix compact conversion to Solr document.


Project: http://git-wip-us.apache.org/repos/asf/lucene-solr/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucene-solr/commit/29a38f15
Tree: http://git-wip-us.apache.org/repos/asf/lucene-solr/tree/29a38f15
Diff: http://git-wip-us.apache.org/repos/asf/lucene-solr/diff/29a38f15

Branch: refs/heads/jira/solr-10247
Commit: 29a38f15d2424b3e92e8ba770660734976658498
Parents: 0a312af
Author: Andrzej Bialecki <ab@apache.org>
Authored: Mon Mar 13 11:52:13 2017 +0100
Committer: Andrzej Bialecki <ab@apache.org>
Committed: Mon Mar 13 11:52:13 2017 +0100

----------------------------------------------------------------------
 solr/core/src/java/org/apache/solr/util/stats/MetricUtils.java | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/29a38f15/solr/core/src/java/org/apache/solr/util/stats/MetricUtils.java
----------------------------------------------------------------------
diff --git a/solr/core/src/java/org/apache/solr/util/stats/MetricUtils.java b/solr/core/src/java/org/apache/solr/util/stats/MetricUtils.java
index d65386c..ca0fd2b 100644
--- a/solr/core/src/java/org/apache/solr/util/stats/MetricUtils.java
+++ b/solr/core/src/java/org/apache/solr/util/stats/MetricUtils.java
@@ -46,6 +46,7 @@ import org.apache.solr.metrics.AggregateMetric;
 public class MetricUtils {
 
   public static final String METRIC_NAME = "metric";
+  public static final String VALUE = "value";
   public static final String VALUES = "values";
 
   static final String MS = "_ms";
@@ -179,7 +180,8 @@ public class MetricUtils {
 
   public static void toSolrInputDocument(String prefix, SolrInputDocument doc, Object o)
{
     if (!(o instanceof Map)) {
-      doc.addField("value", o);
+      String key = prefix != null ? prefix : VALUE;
+      doc.addField(key, o);
       return;
     }
     Map<String, Object> map = (Map<String, Object>)o;


Mime
View raw message