I'm writing a Perl wrapper around it, and one issue I've come across
is that the JSON it returns is not strictly correct.
Actually, there seems to be a bug in the JSON handling. It seems that
you accept invalid data (eg with unquoted property names), store it as a
string, but then you return that string as though it were valid JSON.
Compare:
- VALID JSON IN -> VALID JSON OUT
curl -XPUT http://localhost:9200/twitter/tweet/1 -d '
{
"user" : "kimchy"
}
'
{"ok":true,"_index":"twitter","_type":"tweet","_id":"1"}
> curl -XGET http://localhost:9200/twitter/tweet/1
----------------------------------------------------------
{"_index":"twitter","_type":"tweet","_id":"1", "_source" :
{
"user" : "kimchy"
}
}
2) INVALID JSON IN -> INVALID JSON OUT
curl -XPUT http://localhost:9200/twitter/tweet/2 -d '
{
user : "kimchy"
}
'
----------------------------------------------------------
{"ok":true,"_index":"twitter","_type":"tweet","_id":"2"}
curl -XGET http://localhost:9200/twitter/tweet/2
----------------------------------------------------------
{"_index":"twitter","_type":"tweet","_id":"2", "_source" :
{
user : "kimchy"
}
}
clint
--
Web Announcements Limited is a company registered in England and Wales,
with company number 05608868, with registered address at 10 Arvon Road,
London, N5 1PR.