LoginSignup
2
3

More than 5 years have passed since last update.

小ネタ:elasticsearch の query DSL にはコメントやJSONでないものも受け付ける

Posted at

ソースはここ https://github.com/elastic/elasticsearch/blob/master/src/main/java/org/elasticsearch/common/xcontent/json/JsonXContent.java#L46

以下の3つどれもOKでした。

curl -XPOST http://localhost:9200/twitter/tweets/_search -d'{    
    "query" : { /* コメント!!! */
        "filtered" : {
            "query" : { "match_all" : {}}
        }
    } // コメコメ
}'
curl -XPOST http://localhost:9200/twitter/tweets/_search -d'{    
    query : { 
        filtered : {
            query : { match_all : {}}
        }
    }
}'
curl -XPOST http://localhost:9200/twitter/tweets/_search -d'{    
    'query' : { 
        'filtered' : {
            'query' : { 'match_all' : {}}
        }
    } 
}'
2
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
2
3