2
我有一個現有的索引,其默認ElasticSearch相似度用於所有字段。我想更新這個索引並設置一些其他類型的相似性,比如BM25。我試過的查詢是:ElasticSearch - 更新現有索引的相似性度量值
curl -XPOST 'http://localhost:9200/myindex/' -d '
{
"settings":
{
"similarity":
{
"newSimilarity":
{
"type":"BM25"
}
}
}
}'
但是,這個崩潰與IndexAlreadyExists異常。我也曾嘗試
curl -XPUT 'http://localhost:9200/doc/_mapping' -d '
{
"doc":
{
"properties":
{
"myField":
{
"type":"string",
"term_vector":"with_positions_offsets_payloads",
"similarity":"BM25"
}
}
}
}
這給了我一個MergeMappingException - [合併失敗,失敗{[映射器[TEXT_CONTENT]有不同的相似性。將ignore_conflicts設置爲true並不真正有幫助,它會忽略衝突但不會更改映射。
不過,我想知道是否有可能更新此索引內所有字段的相似性度量,而無需重新索引數據。任何建議將不勝感激。
謝謝!