elasticsearch,similarity,Indexing,Lucene,elasticsearch,Similarity" /> elasticsearch,similarity,Indexing,Lucene,elasticsearch,Similarity" />

Indexing ElasticSearch-更新现有索引的相似性度量

Indexing ElasticSearch-更新现有索引的相似性度量,indexing,lucene,elasticsearch,similarity,Indexing,Lucene,elasticsearch,Similarity,我有一个现有索引,所有字段都使用默认的ElasticSearch相似性。我想更新这个索引并设置一些其他类型的相似性,比如BM25。我尝试的查询是: curl -XPOST 'http://localhost:9200/myindex/' -d ' { "settings": { "similarity": { "newSimilarity": { "type":"BM25"

我有一个现有索引,所有字段都使用默认的ElasticSearch相似性。我想更新这个索引并设置一些其他类型的相似性,比如BM25。我尝试的查询是:

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-[Merge failed with failures{[mapper[text_content]具有不同的相似性。将ignore_conflicts设置为true并没有真正的帮助,它会忽略冲突,但不会更改映射

尽管如此,我还是想知道是否有可能在不重新编制数据索引的情况下更新该索引中所有字段的相似性度量。如有任何建议,将不胜感激


谢谢!

目前elasticsearch不允许动态更改相似性。您必须重新编制索引