【发布时间】:2013-01-19 22:42:42
【问题描述】:
我一直在挖掘Elastical 源代码,试图弄清楚在创建索引时如何设置核心类型。具体来说,我需要将一个字段设置为 geo_point 字段。
在Mongoosastic 中,我只是在我的架构上设置了 es_type 字段,但我不知道如何在 Elastical 中进行等效操作。
谢谢!
【问题讨论】:
标签: node.js elasticsearch
我一直在挖掘Elastical 源代码,试图弄清楚在创建索引时如何设置核心类型。具体来说,我需要将一个字段设置为 geo_point 字段。
在Mongoosastic 中,我只是在我的架构上设置了 es_type 字段,但我不知道如何在 Elastical 中进行等效操作。
谢谢!
【问题讨论】:
标签: node.js elasticsearch
看起来我在寻找“putMapping”函数。
elastical.putMapping(index, type, {'type': {'properties': {"coords" : {"type" : "geo_point", "store": "yes"}}}}, function(e,r){});
【讨论】: