我在弹性搜索中的数据在哪里

时间:2017-10-26 14:08:41

标签: amazon-web-services curl elasticsearch

我尝试使用弹性搜索,我已经使用文档中提供的卷曲创建并将样本数据上传到ES。

这是我的电影资料。

{ "index" : { "_index": "movies", "_type" : "listings", "_id" : "2" } }
{"director": "Frankenheimer, John", "genre": ["Drama", "Mystery", "Thriller"], "year": 1962, "actor": ["Lansbury, Angela", "Sinatra, Frank", "Leigh, Janet", "Harvey, Laurence", "Silva, Henry", "Frees, Paul", "Gregory, James", "Bissell, Whit", "McGiver, John", "Parrish, Leslie", "Edwards, James", "Flowers, Bess", "Dhiegh, Khigh", "Payne, Julie", "Kleeb, Helen", "Gray, Joe", "Nalder, Reggie", "Stevens, Bert", "Masters, Michael", "Lowell, Tom"], "title": "The Manchurian Candidate"}
{ "index" : { "_index": "movies", "_type" : "listings", "_id" : "3" } }
{"director": "Baird, Stuart", "genre": ["Action", "Crime", "Thriller"], "year": 1998, "actor": ["Downey Jr., Robert", "Jones, Tommy Lee", "Snipes, Wesley", "Pantoliano, Joe", "Jacob, Ir\u00e8ne", "Nelligan, Kate", "Roebuck, Daniel", "Malahide, Patrick", "Richardson, LaTanya", "Wood, Tom", "Kosik, Thomas", "Stellate, Nick", "Minkoff, Robert", "Brown, Spitfire", "Foster, Reese", "Spielbauer, Bruce", "Mukherji, Kevin", "Cray, Ed", "Fordham, David", "Jett, Charlie"], "title": "U.S. Marshals"}
{ "index" : { "_index": "movies", "_type" : "listings", "_id" : "4" } }
{"director": "Ray, Nicholas", "genre": ["Drama", "Romance"], "year": 1955, "actor": ["Hopper, Dennis", "Wood, Natalie", "Dean, James", "Mineo, Sal", "Backus, Jim", "Platt, Edward", "Ray, Nicholas", "Hopper, William", "Allen, Corey", "Birch, Paul", "Hudson, Rochelle", "Doran, Ann", "Hicks, Chuck", "Leigh, Nelson", "Williams, Robert", "Wessel, Dick", "Bryar, Paul", "Sessions, Almira", "McMahon, David", "Peters Jr., House"], "title": "Rebel Without a Cause"}

当我点击post命令时,我得到了响应

{
    "took": 90,
    "errors": false,
    "items": [
        {
            "index": {
                "_index": "movies",
                "_type": "listings",
                "_id": "2",
                "_version": 2,
                "result": "updated",
                "_shards": {
                    "total": 2,
                    "successful": 2,
                    "failed": 0
                },
                "created": false,
                "status": 200
            }
        },
        {
            "index": {
                "_index": "movies",
                "_type": "listings",
                "_id": "3",
                "_version": 2,
                "result": "updated",
                "_shards": {
                    "total": 2,
                    "successful": 2,
                    "failed": 0
                },
                "created": false,
                "status": 200
            }
        }
    ]
}

现在我正在尝试搜索我上传的数据。这是我的疑问。

curl -XGET" myEndPoint.us-east-1.es.amazonaws.com/movies/_search?q = rebel"

当我运行时,我得到如下的响应。

{
    "took": 15,
    "timed_out": false,
    "_shards": {
        "total": 5,
        "successful": 5,
        "failed": 0
    },
    "hits": {
        "total": 0,
        "max_score": null,
        "hits": []
    }
}

我尝试通过进入myEndPoint.us-east-1.es.amazonaws.com/_cat/indices?v查看数据,然后返回以下数据。

我想知道我的数据所在的位置是否有一些具有此数据的Dynamo Db。

我对如何查询数据感到困惑(也有多个要搜索的单词),看看我的数据在哪里。

enter image description here

1 个答案:

答案 0 :(得分:0)

根据分析器...搜索可以区分大小写,您可以在没有查询的情况下进行搜索以检查索引。 curl -XGET "myEndPoint.us-east-1.es.amazonaws.com/movies/_search"

Lucene将其索引存储在文件中。 Elasticsearch对那些跨节点的内容进行分片。您在使用AWS搜索服务时无权访问。