Elasticsearch: Bulk Inserting Examples
Elasticsearch: Bulk Inserting Examples :
http://queirozf.com/entries/elasticsearch-bulk-inserting-examples
Note that the URL used contains both the index and the type. This is the case when all documents belong to the same type and will be inserted into the same index.
POST http://path.to.your.cluster/myIndex/person/_bulk
{ "index":{} }
{ "name":"john doe","age":25 }
{ "index":{} }
{ "name":"mary smith","age":32 }
The structure is more or less like this: one line with the action you want to perform (in this case, "index") and a line with the actual document. Repeat as many times as you want, and don't forget the extra newline at the end.
相关推荐
另外一部分,则需要先做聚类、分类处理,将聚合出的分类结果存入ES集群的聚类索引中。数据处理层的聚合结果存入ES中的指定索引,同时将每个聚合主题相关的数据存入每个document下面的某个field下。