Hi everyone,

If was experimenting on mappings for index size optimization purpose and I 
have an issue, it seems a bug to me, I cannot find any documentaion about 
it.

When I declare a field of type *byte *ES seems to be considering it as 
*short*, for proof see the error message of the last curl below, it 
mentions the short type even though I declared a byte
(*MapperParsingException[failed to parse [some_data]]; nested: 
JsonParseException[Numeric value (32768) out of range of Java short*)

*Every has been tested on a freshly untared ES.*

*# Create the index*
curl -XPUT 'http://localhost:9200/some_index?pretty' -d '
{
    "mappings": {
        "some_type": {
            "dynamic": "strict",
            "properties": {
                "some_data": {
                    "type": "byte"
                }
            }
        }
    }
}
'

*# Insert a doc with a value just out of the range of the byte type, 
success, wierd*
curl -XPUT "http://localhost:9200/some_index/some_type/1?pretty"; -d '
{
    "some_data": 256
}
'

*# Insert a doc with the max value for the short type, success, still wierd*
curl -XPUT "http://localhost:9200/some_index/some_type/1?pretty"; -d '
{
    "some_data": 32767
}
'

*# Insert a doc with a value just out of the range of the short type, 
failure, ok I get it, ES sees it as a short...*
curl -XPUT "http://localhost:9200/some_index/some_type/1?pretty"; -d '
{
    "some_data": 32768
}
'

*java -version* outputs :
java version "1.7.0_07"
Java(TM) SE Runtime Environment (build 1.7.0_07-b10)
Java HotSpot(TM) 64-Bit Server VM (build 23.3-b01, mixed mode)

*lsb_release -a* outputs :
Distributor ID:    Ubuntu
Description:    Ubuntu 12.04.5 LTS
Release:    12.04
Codename:    precise

*uname -r* outputs:
3.1.10-1.9-ec2

*ES info* : ES 1.4.0

*Thanks in advance for the help.*

Damien

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/elasticsearch/2af44e04-e495-4641-a275-348d6ce73d5b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to