'JSON'에 해당되는 글 12건

  1. 2013.08.14 [Elasticsearch] json bulk insert.
  2. 2013.05.09 [Java] JSON String to Map(Object).

[Elasticsearch] json bulk insert.

Elastic/Elasticsearch 2013. 8. 14. 12:09

참고 사이트 : http://www.elasticsearch.org/guide/reference/api/bulk/


[Run]

curl -s -XPOST 'http://192.168.56.104:9200/test/_bulk' --data-binary @test.json


[test.json]

{ "index" : { "_index" : "test", "_type" : "type1", "_id" : "1" , "_routing" : "1" } }

{"docid":1, "title":"title1"}

{ "index" : { "_index" : "test", "_type" : "type1", "_id" : "2" , "_routing" : "1" } }

{"docid":2, "title":"title2"}

{ "index" : { "_index" : "test", "_type" : "type1", "_id" : "3" , "_routing" : "1" } }

{"docid":3, "title":"title3"}



:

[Java] JSON String to Map(Object).

ITWeb/개발일반 2013. 5. 9. 10:41

- 사용라이브러리 : Jackson

- URL : http://wiki.fasterxml.com/JacksonDocumentation


[Code]

ObjectMapper mapper = new ObjectMapper();

Map<String, Object> mapObj = mapper.readValue(jsonStr, new TypeReference<Map<String, Object>>() {});


- 너무 쉬워서 여기서 마무리 합니다.

: