一、基于_version的樂觀鎖并發(fā)控制 語法:PUT /test_index/test_type/id?version=xxx 更新時(shí)帶上數(shù)據(jù)的版本號(hào),只有版本號(hào)一致的情況下才可以修改,如果出現(xiàn)版本號(hào)不一致的情況或者丟棄該數(shù)據(jù)或者獲取最新的版本號(hào)然后在進(jìn)行更新PUT /test_index/test_type/7?version=1{ "...
Read More
一、生成document id1、自動(dòng)生成document id 自動(dòng)生成的id,長度為20個(gè)字符,URL安全,base64編碼,GUID,分布式系統(tǒng)并行生成時(shí)不可能會(huì)發(fā)生沖突 語法:POST /index/typePOST /test_index/test_type{ "test_conten...
Read More
一、索引元數(shù)據(jù)執(zhí)行:GET /ecommerce/product/1返回結(jié)果:{ "_index": "ecommerce", "_type": "product", "_id": "1", "_version": 1, "found": true, "_source": { "name": "gaolujie yagao", "desc": "g
Read More