0
votes

I'm trying out my hands on Elastic Search, I've created and uploaded a sample data onto ES using the curl as provided in the document.

Here is my movies data.

{ "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"}

When I hit the post command I get the response as

{
    "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
            }
        }
    ]
}

and now I'm trying to search in the data that I've uploaded. and here is my query.

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

when I run this I get the response as below.

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

I tried looking into data by going into myEndPoint.us-east-1.es.amazonaws.com/_cat/indices?v and it is returning me the below data.

I would like to know Where my data is residing is there some Dynamo Db that has this data.

I'm pretty much confused on how to query the data(also there are multiple words to search for) and see where my data is.

enter image description here

1

1 Answers

0
votes

Depending on the analyzer... search can be case sensitive, you can do a search without the query to check your index. curl -XGET "myEndPoint.us-east-1.es.amazonaws.com/movies/_search"

Lucene stores it's indices in files. Elasticsearch shards those accross the nodes. Which you won't have access to when you are using the AWS search service.