반응형
Recent Posts
Recent Comments
관리 메뉴

개발잡부

[es] 스코어 계산 확인 - explain 본문

ElasticStack/Elasticsearch

[es] 스코어 계산 확인 - explain

닉의네임 2022. 6. 20. 08:48
반응형

GET hyper-item/_search?explain=true&pretty

 

GET hyper-item/_search?explain=true&pretty
{
  "from": 0,
  "size": 100,
  "timeout": "60s",
  "query": {
    "bool": {
      "must": [
        {
          "function_score": {
            "query": {
              "multi_match": {
                "query": "봉지라면",
                "fields": [
                  "brandNmEng^1.0",
                  "brandNmKor^1.0",
                  "category.categorySearchKeyword^1.0",
                  "category.dcateNm^1.0",
                  "isbn^1.0",
                  "itemNo^1.0",
                  "itemOptionNms^1.0",
                  "itemStoreInfo.eventInfo.eventKeyword^1.0",
                  "searchItemNm^1.0",
                  "searchKeyword^1.0"
                ],
                "type": "cross_fields",
                "operator": "AND",
                "slop": 0,
                "prefix_length": 0,
                "max_expansions": 50,
                "zero_terms_query": "NONE",
                "auto_generate_synonyms_phrase_query": false,
                "fuzzy_transpositions": true,
                "boost": 1
              }
            },
            "functions": [
              {
                "filter": {
                  "match_all": {
                    "boost": 1
                  }
                },
                "weight": 0
              }
            ],
            "score_mode": "sum",
            "boost_mode": "replace",
            "max_boost": 3.4028235e+38,
            "boost": 1
          }
        }
      ],
      "filter": [
        {
          "range": {
            "saleStartDt": {
              "from": null,
              "to": "now/m",
              "include_lower": true,
              "include_upper": true,
              "boost": 1
            }
          }
        },
        {
          "range": {
            "saleEndDt": {
              "from": "now/m",
              "to": null,
              "include_lower": true,
              "include_upper": true,
              "boost": 1
            }
          }
        },
        {
          "term": {
            "docDispYn": {
              "value": "Y",
              "boost": 1
            }
          }
        },
        {
          "bool": {
            "should": [
              {
                "terms": {
                  "itemStoreInfo.storeId": [
                    "37"
                  ],
                  "boost": 1
                }
              },
              {
                "term": {
                  "shipMethod": {
                    "value": "TD_DLV",
                    "boost": 1
                  }
                }
              },
              {
                "term": {
                  "storeType": {
                    "value": "DS",
                    "boost": 1
                  }
                }
              }
            ],
            "adjust_pure_negative": true,
            "boost": 1
          }
        }
      ],
      "should": [
        {
          "multi_match": {
            "query": "봉지라면",
            "fields": [
              "edlp.addKeyword^1.0",
              "edlp.keyword^1.0"
            ],
            "type": "best_fields",
            "operator": "OR",
            "slop": 0,
            "prefix_length": 0,
            "max_expansions": 50,
            "zero_terms_query": "NONE",
            "auto_generate_synonyms_phrase_query": true,
            "fuzzy_transpositions": true,
            "boost": 1
          }
        }
      ],
      "adjust_pure_negative": true,
      "boost": 1
    }
  },
  "_source": {
    "includes": [
      "*"
    ],
    "excludes": []
  },
  "sort": [
    {
      //sort의 영역
    }
  ]
}
반응형

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

[es] Nested Query vs Object Query  (0) 2022.06.21
[es] nested query test  (0) 2022.06.21
[es] analyzer test  (0) 2022.06.19
[es] payload-score 7.15.1 gradle  (0) 2022.05.22
[es] High level client for Java sort  (1) 2022.05.16
Comments