LoginSignup
1
3

More than 5 years have passed since last update.

ElasticsearchのScriptを使った検索

Posted at

ElasticsearchのScriptを使った検索

  • scriptを使用することで、下記のような検索が可能です。

▼ createdとmodifiedが等しいドキュメントの検索

GET index_name/type_name/_search
{
  "query": {
    "filtered": {
      "filter": {
        "bool": {
          "must": [
            {
              "script": {
                "script": "doc['created'].value == (doc['modified'].value)",
                "params": {}
              }
            }
          ]
        }
      }
    }
  }
}
1
3
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
3