ElasticSearch CouchDB地理位置

时间:2013-08-19 13:10:51

标签: elasticsearch shape geo

我试图让elasticsearch索引一条没有运气的couchdb河。 我有一个数据库'pl1',里面只有一个文件'1'。 这是整个文件的打印输出:

curl -XGET localhost:5984/pl1/1 | python -mjson.tool

{
    "_id": "1", 
    "_rev": "1-0442f3962cffedc2238fcdb28dd77557", 
    "location": {
        "geo_json": {
            "coordinates": [
                59.70141999133738, 
                14.162789164118708
            ], 
            "type": "point"
        }, 
        "lat": 14.162789164118708, 
         "lon": 59.70141999133738
    }
}

我用以下方式创建了一个名为all_entries的catch-all类型的couchdb河和索引:

curl -XPUT 'localhost:9200/_river/pl1/_meta' -d '
{
    "type" : "couchdb",
    "couchdb" : {
        "host" : "localhost",
        "port" : 5984,
        "filter" : null,
        "db" : "pl1"
    },
    "index" : {
        "index" : "pl1",
        "type" : "all_entries",
        "bulk_size" : "100",
        "bulk_timeout" : "10ms"
    }
}'   


{"ok":true,"_index":"_river","_type":"pl1","_id":"_meta","_version":1}

要测试文档是否已编制索引,请执行以下查询:

curl -XGET localhost:9200/pl1/all_entries/_count?pretty=true
{
    "count" : 1,
    "_shards" : {
        "total" : 5,
        "successful" : 5,
        "failed" : 0
    }
}

但是没有。我无法弄清楚如何使用geo_shape类型索引位置(我也尝试使用不同的geo_point格式的数据,并索引,但也没有结果)

如何为此指定映射器和查询?

0 个答案:

没有答案
相关问题