반응형
Recent Posts
Recent Comments
관리 메뉴

개발잡부

[es8] similarity modules 본문

ElasticStack8/Elasticsearch

[es8] similarity modules

닉의네임 2023. 5. 16. 22:07
반응형

https://www.elastic.co/guide/en/elasticsearch/reference/current/index-modules-similarity.html#index-modules-similarity

 

Similarity module | Elasticsearch Guide [8.7] | Elastic

While scripted similarities provide a lot of flexibility, there is a set of rules that they need to satisfy. Failing to do so could make Elasticsearch silently return wrong top hits or fail with internal errors at search time:

www.elastic.co

 

#DFR
PUT /index
{
  "settings": {
    "index": {
      "similarity": {
        "my_similarity": {
          "type": "DFR",
          "basic_model": "g",
          "after_effect": "l",
          "normalization": "h2",
          "normalization.h2.c": "3.0"
        }
      }
    }
  }
}


#BM25
PUT /index
{
  "settings": {
    "index": {
      "similarity": {
        "bm25_similarity": {
          "type": "BM25",
          "k1": "1",
          "b": "1",
          "discount_overlaps": "true"
        }
      }
    }
  }
}


#DFI
PUT /index
{
  "settings": {
    "index": {
      "similarity": {
        "bm25_similarity": {
          "type": "DFI",
          "independence_measure": "chisquared"          
        }
      }
    }
  }
}


#IB
PUT /index
{
  "settings": {
    "index": {
      "similarity": {
        "bm25_similarity": {
          "type": "IB",
          "distribution": "spl",
          "lambda": "df",
          "normalization": "h2",
          "normalization.h2.c": "3.0"
        }
      }
    }
  }
}


#LM Dirichlet
PUT /index
{
  "settings": {
    "index": {
      "similarity": {
        "bm25_similarity": {
          "type": "LMDirichlet",
          "mu": "2000"
        }
      }
    }
  }
}

 

PUT /index/_mapping
{
  "properties" : {
    "title" : { "type" : "text", "similarity" : "my_similarity" }
  }
}

반응형

'ElasticStack8 > Elasticsearch' 카테고리의 다른 글

[es8] elasticsearch stable-esplugin  (0) 2023.05.21
[es8] Elasticsearch Plugin 8.6.2  (0) 2023.05.20
[es] _explain  (0) 2023.05.09
[es8] ignore_malformed  (0) 2023.01.23
[es8] index 와 shard 사이즈  (0) 2022.10.06
Comments