光是建立 Engine,文件沒有放進去的話,還不會產生對應的 Index ,所以我們再次透過 App Search UI 來新增一份文件。
以下是我從預設的範例精簡後的版本:
[
{
"id": "park_rocky-mountain",
"title": "Rocky Mountain",
"description": "Bisected north to south by the Continental Divide, this portion of the Rockies has ecosystems varying from over 150 riparian lakes to montane and subalpine forests to treeless alpine tundra. Wildlife including mule deer, bighorn sheep, black bears, and cougars inhabit its igneous mountains and glacial valleys. Longs Peak, a classic Colorado fourteener, and the scenic Bear Lake are popular destinations, as well as the historic Trail Ridge Road, which reaches an elevation of more than 12,000 feet (3,700 m).",
"visitors": 4517585,
"location": "40.4,-105.58",
"date": "1915-01-26T06:00:00Z"
}
]
會發現多了一個 .ent-search-engine-5f7cc70189dec99f64b0dd35 的 Index ,也就是我們這個 Engine 的 Index ,並且 docs.count 顯示裡面有一份文件。
Query Indexed Document
我們先簡單的查看這個裡面的 Document 長什麼樣子:
GET .ent-search-engine-5f7cc70189dec99f64b0dd35/_search
以下是回傳的結果:
{
"took" : 4,
"timed_out" : false,
"_shards" : {
"total" : 2,
"successful" : 2,
"skipped" : 0,
"failed" : 0
},
"hits" : {
"total" : {
"value" : 1,
"relation" : "eq"
},
"max_score" : 1.0,
"hits" : [
{
"_index" : ".ent-search-engine-5f7cc70189dec99f64b0dd35",
"_type" : "_doc",
"_id" : "5f7cc89489dec9fc34b0dd38",
"_score" : 1.0,
"_source" : {
"title$string" : "Rocky Mountain",
"description$string" : "Bisected north to south by the Continental Divide, this portion of the Rockies has ecosystems varying from over 150 riparian lakes to montane and subalpine forests to treeless alpine tundra. Wildlife including mule deer, bighorn sheep, black bears, and cougars inhabit its igneous mountains and glacial valleys. Longs Peak, a classic Colorado fourteener, and the scenic Bear Lake are popular destinations, as well as the historic Trail Ridge Road, which reaches an elevation of more than 12,000 feet (3,700 m).",
"visitors$string" : "4517585",
"location$string" : "40.4,-105.58",
"date$string" : "1915-01-26T06:00:00Z",
"id" : "5f7cc89489dec9fc34b0dd38",
"external_id" : "park_rocky-mountain",
"engine_id" : "5f7cc70189dec99f64b0dd35",
"__st_text_summary" : "Rocky Mountain Bisected north to south by the Continental Divide, this portion of the Rockies has ecosystems varying from over 150 riparian lakes to montane and subalpine forests to treeless alpine tundra. Wildlife including mule deer, bighorn sheep, black bears, and cougars inhabit its igneous mountains and glacial valleys. Longs Peak, a classic Colorado fourteener, and the scenic Bear Lake are popular destinations, as well as the historic Trail Ridge Road, which reaches an elevation of more than 12,000 feet (3,700 m). 4517585 40.4,-105.58 1915-01-26T06:00:00Z",
"__st_expires_after" : null
}
}
]
}
}
{
"took" : 256,
"timed_out" : false,
"_shards" : {
"total" : 2,
"successful" : 2,
"skipped" : 0,
"failed" : 0
},
"hits" : {
"total" : {
"value" : 1,
"relation" : "eq"
},
"max_score" : 1.0,
"hits" : [
{
"_index" : ".ent-search-engine-5f7cc70189dec99f64b0dd35",
"_type" : "_doc",
"_id" : "5f7cc89489dec9fc34b0dd38",
"_score" : 1.0,
"_source" : {
"title$string" : "Rocky Mountain",
"description$string" : "Bisected north to south by the Continental Divide, this portion of the Rockies has ecosystems varying from over 150 riparian lakes to montane and subalpine forests to treeless alpine tundra. Wildlife including mule deer, bighorn sheep, black bears, and cougars inhabit its igneous mountains and glacial valleys. Longs Peak, a classic Colorado fourteener, and the scenic Bear Lake are popular destinations, as well as the historic Trail Ridge Road, which reaches an elevation of more than 12,000 feet (3,700 m).",
"visitors$float" : 4517585.0,
"location$location" : "40.4,-105.58",
"date$date" : "1915-01-26T06:00:00+00:00",
"id" : "5f7cc89489dec9fc34b0dd38",
"external_id" : "park_rocky-mountain",
"engine_id" : "5f7cc70189dec99f64b0dd35",
"__st_text_summary" : "Rocky Mountain Bisected north to south by the Continental Divide, this portion of the Rockies has ecosystems varying from over 150 riparian lakes to montane and subalpine forests to treeless alpine tundra. Wildlife including mule deer, bighorn sheep, black bears, and cougars inhabit its igneous mountains and glacial valleys. Longs Peak, a classic Colorado fourteener, and the scenic Bear Lake are popular destinations, as well as the historic Trail Ridge Road, which reaches an elevation of more than 12,000 feet (3,700 m). 4517585 40.4,-105.58 1915-01-26T06:00:00Z",
"__st_expires_after" : null
}
}
]
}
}