ElasticStack/Elasticsearch
[es] query score test
닉의네임
2021. 12. 26. 22:01
반응형
GET shop/_search
{
"from": 0,
"size": 10,
"timeout": "200ms",
"query": {
"function_score": {
"query": {
"bool": {
"must": [
{
"multi_match": {
"query": "루이 비통",
"fields": [
"name^0.0",
"category",
"category1",
"category2",
"category3",
"category4",
"category5"
],
"type": "best_fields",
"operator": "or"
}
}
]
}
},
"functions": [
{
"script_score": {
"script": {
"source": "1 + doc['weight'].value + _score ",
"lang": "painless"
}
}
}
],
"score_mode": "multiply",
"boost_mode": "multiply",
"max_boost": 3.4028235e+38,
"boost": 1
}
},
"_source": {
"includes": [
"name",
"price",
"category"
],
"excludes": []
}
}
반응형