Elasticsearch DSL语法( 二 )

  1. 范围搜索
GET /goods_index/_search{"query":{"bool":{"must":[{"query_string":{"query":"双重好礼","fields": ["goods_title^2"]}}]}},"_source": ["goods_title","goods_subtitle","selling_price"], "post_filter": {"range": {"selling_price": {"gte": 0,"lte": 108}}}}
  1. in 查询
GET /goods_index/_search{"query":{"bool":{"must":[{"query_string":{"query":"双重好礼","fields": ["goods_title"]}},{"terms": {"specs_type": ["more"]}}]}}}NOT IN 查询GET /goods_index/_search{"query":{"bool":{"must":[{"query_string":{"query":"双重好礼","fields": ["goods_title"]}}],"must_not":[{"terms":{"specs_type": ["more"]}}]}}}

【Elasticsearch DSL语法】


推荐阅读