开启script:

Scripting settingsedit

The script.disable_dynamic node setting has been replaced by fine-grained script settings described in the scripting docs. The following setting previously used to enable dynamic or inline scripts:

script.disable_dynamic: false

It should be replaced with the following two settings in elasticsearch.yml that achieve the same result:

script.inline: on
script.indexed: on

脚本使用,特别注意写法:
curl -XGET 'hm:9200/cars/transactions/_search?search_type=count' -d '
{
    "aggs":{
        "make":{
            "cardinality":{
                "script": "doc[\"make\"].value"
            }
        }
    }
}'

curl -XGET 'hm:9200/cars/transactions/_search?search_type=count' -d '
{
    "aggs":{
        "make":{
            "cardinality":{
                "script": "doc['"'"'make'"'"'].value"
            }
        }
    }
}'


doc[\"dtEventTime\"].date.getHourOfDay()

相关文章:

  • 2021-09-17
  • 2021-04-07
  • 2022-12-23
  • 2021-06-04
  • 2021-07-30
  • 2022-12-23
  • 2022-12-23
  • 2021-06-08
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-04-14
  • 2022-12-23
相关资源
相似解决方案