這是 Elasticsearch 檔案中關于型別store選項的一部分text:
默認情況下,對欄位值進行索引以使其可搜索,但不會存盤它們。這意味著可以查詢該欄位,但無法檢索原始欄位值。
我不明白默認情況下不存盤欄位是什么意思。這怎么可能?我確定我在這里遺漏了一些東西。有人可以用簡單的英語向我解釋嗎?
關聯
uj5u.com熱心網友回復:
讓我們假設如果您想存盤并希望在搜索結果中出現,當您使用標題中的任何單詞進行搜索時,例如 : hello world in Elasticsearchor or ..比您需要在 Elasticsearch倒排索引中擁有這些搜索詞的標記..titlehelloworldElasticsearch
默認情況下,所有 Elasticsearch 文本欄位都經過文本分析(為輸入文本創建標記(純英語世界))。
現在在我們的示例中,給定的標題將生成下面的令牌,您還可以使用下面的 API 驗證自己
GET http://es:9200/_analyze
{
"text" : "hello world in Elasticsearch",
"analyzer": "standard"
}
以及由此產生的令牌
{
"tokens": [
{
"token": "hello",
"start_offset": 0,
"end_offset": 5,
"type": "<ALPHANUM>",
"position": 0
},
{
"token": "world",
"start_offset": 6,
"end_offset": 11,
"type": "<ALPHANUM>",
"position": 1
},
{
"token": "in",
"start_offset": 12,
"end_offset": 14,
"type": "<ALPHANUM>",
"position": 2
},
{
"token": "elasticsearch",
"start_offset": 15,
"end_offset": 28,
"type": "<ALPHANUM>",
"position": 3
}
]
}
現在 store 表示欄位的完整字串 aka(未標記化)hello world in Elasticsearch,該欄位對全文搜索沒有用,如 Elasticsearch 文章中所述,默認情況下存盤為_source.
希望這可以幫助。
轉載請註明出處,本文鏈接:https://www.uj5u.com/ruanti/530375.html
標籤:弹性搜索
