1

我正在尝试让 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 的包罗万象类型的 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 格式的数据,并对其进行索引,但也没有结果)

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

4

0 回答 0