1.按日期衰变

GET news/doc/_search
{
  "query" : {
    "function_score": {
        "query": {"multi_match" : {
                "query" : "生物医药",
                "fields": ["title"],
                "type":"phrase"
            }
          
        },
        "functions": [
            {
              "gauss": {
                "pdate": {
                  "origin": "2019-07-01",
                  "scale": "180d",
                  "decay": 0.5,
                  "offset": "30d"
                }
              }
            },
            { 
              "script_score": {
                "script": "return doc ['org_name'].value == '国信证券' ? 1.9 : 1.0"
             }
            }
        ],
        
      "score_mode": "sum",
      "boost_mode": "multiply"
  }},
  "_source":["title","org_name","pdate"]
}

 

 

 

 

 

 

 

 

 

参考资料:https://blog.csdn.net/weixin_40341116/article/details/81003513

https://www.scienjus.com/elasticsearch-function-score-query/

相关文章:

  • 2022-12-23
  • 2021-12-09
  • 2021-04-05
  • 2022-01-22
  • 2022-12-23
  • 2021-08-24
  • 2022-12-23
  • 2021-09-24
猜你喜欢
  • 2022-12-23
  • 2021-09-03
  • 2022-12-23
  • 2021-10-17
  • 2022-12-23
  • 2022-01-11
  • 2021-12-26
相关资源
相似解决方案