弹性搜索总是return没有结果

Elastic search always return no result

我正在尝试使用以下指令测试弹性搜索:

http://docs.aws.amazon.com/elasticsearch-service/latest/developerguide/es-gsg.html

当我尝试上述操作并上传说明中也包含的以下文本时:

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

在我使用此命令后:

curl -XGET 'search-movies-4f3nw7eiia2xiynjr55a2nao2y.us-west-1.es.amazonaws.com/movies/_search?q=Frankenheimer'

我从来没有得到任何回报。总是 returns 0。这是我得到的结果:

如果我做对了,我不会,但我认为我至少应该能够看到一些东西,因为我在上传的 json 数据的导演键中有 Frankenheimer。任何人都可以阐明它吗?

尝试使用 curl -XGET search-movies-4f3nw7eiia2xiynjr55a2nao2y.us-west-1.es.amazon‌​aws.com/movies/_sear‌​ch 搜索整个索引,默认情况下会 return 前 10 个结果。如果 return 小于 10,则数据可能不在索引中。

您可以通过将查询更改为:

来验证这一点
curl -XGET search-movies-4f3nw7eiia2xiynjr55a2nao2y.us-west-1.es.amazon‌​aws.com/movies/_sear‌​ch?q=director:Burton

查看 Elasticsearch URI Search 以获得完整的参数列表。