chenryn  
                (Chenryn)
               
                 
              
                  
                    April 3, 2015,  8:04am
                   
                   
              1 
               
             
            
              $ cat test.sh 
curl 
1003.es.dip.sina.com.cn:9200/logstash-mweibo-nginx-2015.04.03/v5nginx/_search?q=_id:AUx-QvSBS-dhpiB8_1f1&pretty 
-d '{ 
"fields": ["request_time"], 
"script_fields" : { 
"test1" : { 
"script" : "doc["request_time"].value" 
}, 
"test2" : { 
"script" : "doc["request_time"].value * 1000" 
} 
} 
}'
$ sh test.sh 
{ 
"took" : 7, 
"timed_out" : false, 
"_shards" : { 
"total" : 56, 
"successful" : 56, 
"failed" : 0 
}, 
"hits" : { 
"total" : 1, 
"max_score" : 1.0, 
"hits" : [ { 
"_index" : "logstash-mweibo-nginx-2015.04.03", 
"_type" : "v5nginx", 
"_id" : "AUx-QvSBS-dhpiB8_1f1", 
"_score" : 1.0, 
"fields" : { 
"test2" : [ -8646911284551352000 ], 
"test1" : [ 4603039107142836552 ], 
"request_time" : [ 0.54 ] 
} 
} ] 
} 
}
WHY?
-- 
You received this message because you are subscribed to the Google Groups "elasticsearch" group. 
To unsubscribe from this group and stop receiving emails from it, send an email to elasticsearch+unsubscribe@googlegroups.com . 
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/CABwsoojyVwcf%2BuyG8TuWXEFSwj20L3FFyEKqJVyf8F02oy_4Zw%40mail.gmail.com . 
For more options, visit https://groups.google.com/d/optout .
             
            
               
               
               
            
            
           
          
            
              
                jpountz  
                (Adrien Grand)
               
              
                  
                    April 3, 2015,  9:47am
                   
                   
              2 
               
             
            
              I think you are encoutering this bug: 
Mapping updates should be synchronous · Issue #8688 · elastic/elasticsearch · GitHub . One of your shard 
dynamically mapped request_time as an long and another one as a double. And 
at some point your shards got relocated what you see happening here is that 
the bits of your double value 0.54 are interpreted as a long by 
elasticsearch. The only way to work around this issue for now is to define 
mappings explicitely.
On Fri, Apr 3, 2015 at 10:04 AM, chenlin rao rao.chenlin@gmail.com  wrote:
$ cat test.sh 
curl 
1003.es.dip.sina.com.cn:9200/logstash-mweibo-nginx-2015.04.03/v5nginx/_search?q=_id:AUx-QvSBS-dhpiB8_1f1 &pretty 
http://1003.es.dip.sina.com.cn:9200/logstash-mweibo-nginx-2015.04.03/v5nginx/_search?q=_id:AUx-QvSBS-dhpiB8_1f1\&pretty  
-d '{ 
"fields": ["request_time"], 
"script_fields" : { 
"test1" : { 
"script" : "doc["request_time"].value" 
}, 
"test2" : { 
"script" : "doc["request_time"].value * 1000" 
} 
} 
}'
$ sh test.sh 
{ 
"took" : 7, 
"timed_out" : false, 
"_shards" : { 
"total" : 56, 
"successful" : 56, 
"failed" : 0 
}, 
"hits" : { 
"total" : 1, 
"max_score" : 1.0, 
"hits" : [ { 
"_index" : "logstash-mweibo-nginx-2015.04.03", 
"_type" : "v5nginx", 
"_id" : "AUx-QvSBS-dhpiB8_1f1", 
"_score" : 1.0, 
"fields" : { 
"test2" : [ -8646911284551352000 ], 
"test1" : [ 4603039107142836552 ], 
"request_time" : [ 0.54 ] 
} 
} ] 
} 
}
WHY?
-- 
You received this message because you are subscribed to the Google Groups 
"elasticsearch" group. 
To unsubscribe from this group and stop receiving emails from it, send an 
email to elasticsearch+unsubscribe@googlegroups.com . 
To view this discussion on the web visit 
https://groups.google.com/d/msgid/elasticsearch/CABwsoojyVwcf%2BuyG8TuWXEFSwj20L3FFyEKqJVyf8F02oy_4Zw%40mail.gmail.com  
https://groups.google.com/d/msgid/elasticsearch/CABwsoojyVwcf%2BuyG8TuWXEFSwj20L3FFyEKqJVyf8F02oy_4Zw%40mail.gmail.com?utm_medium=email&utm_source=footer  
. 
For more options, visit https://groups.google.com/d/optout .
 
-- 
Adrien
-- 
You received this message because you are subscribed to the Google Groups "elasticsearch" group. 
To unsubscribe from this group and stop receiving emails from it, send an email to elasticsearch+unsubscribe@googlegroups.com . 
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/CAO5%3DkAgpq06MAEXuK02L3rLaha4u8dK216p%3DZj-pLbejPT6xgg%40mail.gmail.com . 
For more options, visit https://groups.google.com/d/optout .