[英]How to retrieve all documents in elasticsearch
I am a novice in ES and need help. 我是ES的新手,需要帮助。
Here is my data set from JSON 这是我来自JSON的数据集
{
"simplewiki": {
"page": [{
"index": {
"_index": "myindex",
"_type": "wiki",
"_id": "1"
}
},
{
"title": "April",
"url": "https://simple.wikipedia.org/wiki/April",
"abstract": "April is the 4th month of the year, and comes between March and May. It is one of four months to have 30 days.",
"sections": ["The Month", "April in poetry", "Events in April", "Fixed Events", "Moveable Events", "Selection of Historical Events", "Trivia", "References"]
},
{
"index": {
"_index": "myindex",
"_type": "wiki",
"_id": "2"
}
},
{
"title": "August",
"url": "https://simple.wikipedia.org/wiki/August",
"abstract": "August (Aug.) is the 8th month of the year in the Gregorian calendar, coming between July and September.",
"sections": ["The Month", "August observances", "Fixed observances and events", "Moveable and Monthlong events", "Selection of Historical Events", "Trivia", "References"]
}
]
}
}
question is that I used the below command to index: curl -XPOST locahost:9200/myindex/wiki --data-binary @wiki.json 问题是我使用以下命令编制了索引:curl -XPOST locahost:9200 / myindex / wiki --data-binary @ wiki.json
After execution: (52) Empty reply from server and total 2 successful 1 and failed 0. When I use command : curl -XGET localhost:92200/myindex/wiki/1?pretty? 执行后:(52)来自服务器的空答复,总计2成功1,失败0。当我使用命令时:curl -XGET localhost:92200 / myindex / wiki / 1?漂亮吗?
I get the below but not all the details and found is false. 我得到以下内容,但不是全部细节,但发现是错误的。
{
"_index":"myindex",
"_type":"wiki",
"_id":"1",
"found" :false
}
How do I ensure found is true and the whole title and abstract are retrieved. 我如何确保找到的是真实的,并且检索了整个标题和摘要。 Any help is much appreciated. 任何帮助深表感谢。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.