最新的fsriver插件无效

时间:2015-05-23 07:50:39

标签: elasticsearch

我遇到了最新fsriver插件的问题。 我执行了以下命令来索引文档

PUT _river/mynewriver2/_meta
{
    "type": "fs",
    "fs": {
        "url": "d://tmp",
        "update_rate": "1h",
        "includes": [ "*.doc" , "*.xls", "*.txt" ]
    },
    "index": {
        "index": "docs1",
        "type": "doc1",
        "bulk_size": 50
    }  
}

d://tmp里面我有一个带有人名的简单txt文件。 但是当我执行命令检查文档时,我没有收到任何文档。

GET docs1/doc1/_search
output : 
{
    "took": 3,
    "timed_out": false,
    "_shards": {
        "total": 5,
        "successful": 5,
        "failed": 0
    },
    "hits": {
        "total": 0,
        "max_score": null,
        "hits": []
    }
 }

在elasticsearch控制台中,我有以下日志:

[2015-05-23 12:40:40,645][INFO ][cluster.metadata         ] [Ulysses] [.marvel-2015.05.23] update_mapping [cluster_stats] (dynamic)
[2015-05-23 12:40:54,037][INFO ][cluster.metadata         ] [Ulysses] [_river] creating index, cause [auto(index api)], templates [], shards [1]/[1], mappings [mynewriver2]
[2015-05-23 12:40:56,511][INFO ][cluster.metadata         ] [Ulysses] [_river] update_mapping [mynewriver2] (dynamic)
[2015-05-23 12:40:57,023][INFO ][fr.pilato.elasticsearch.river.fs.river.FsRiver] [Ulysses] [fs][mynewriver2] Starting fs river scanning
[2015-05-23 12:40:57,309][INFO ][cluster.metadata         ] [Ulysses] [docs1] creating index, cause [api], templates [], shards [5]/[1], mappings []
[2015-05-23 12:41:00,762][INFO ][cluster.metadata         ] [Ulysses] [.marvel-2015.05.23] update_mapping [index_event] (dynamic)

我在Windows 7(64位)中运行elasticsearch 1.5.2。

1 个答案:

答案 0 :(得分:0)

由于您使用的是Windows系统,根据the documentation,看起来指定的路径不正确,即您应该使用两个反斜线而不是两个正斜杠您的路径或单个正斜杠。您可以尝试删除您的河流并像这样重新创建

PUT _river/mynewriver2/_meta
{
    "type": "fs",
    "fs": {
        "url": "d:\\tmp",
        "update_rate": "1h",
        "includes": [ "*.doc" , "*.xls", "*.txt" ]
    },
    "index": {
        "index": "docs1",
        "type": "doc1",
        "bulk_size": 50
    }  
}

或者像这样:

PUT _river/mynewriver2/_meta
{
    "type": "fs",
    "fs": {
        "url": "d:/tmp",
        "update_rate": "1h",
        "includes": [ "*.doc" , "*.xls", "*.txt" ]
    },
    "index": {
        "index": "docs1",
        "type": "doc1",
        "bulk_size": 50
    }  
}