将 Elasticsearch kibana 查询字符串格式转换为 URI 搜索格式

Alw*_*nny 3 lucene solr amazon-web-services elasticsearch kibana-5

从上周开始,我开始在 AWS 上使用 Elastic Search Service。我当前的 Elasticseach 版本是 6.XX 和 Kibana 6.XX,现在我对 Kibana 客户端上运行的查询格式有点灵活。但我的问题是我无法将查询转换为将在Browser URL/Postman上运行的 URI 格式。例如:如何将其转换为 URI 搜索格式?。

GET my_index/_search
{
  "query": {
    "geo_bounding_box": { 
      "location": {
        "top_left": {
          "lat": 42,
          "lon": -72
        },
        "bottom_right": {
          "lat": 40,
          "lon": -74
        }
      }
    }
  }
}
Run Code Online (Sandbox Code Playgroud)

我在这里看到了有关 URI 搜索格式的文档,其中包含qdf等不同参数https : //www.elastic.co/guide/en/elasticsearch/reference/6.0/search-uri-request.html但不能将上述查询字符串转换为 URI 搜索格式。实际上,我对支持q、fq、排序、开始、行、boost、facet、group等的SOLR 查询格式非常灵活。所以,据我所知,弹性搜索也使用了 Lucene 索引,所以我的基本问题是

1.如何将上述 ES 查询字符串转换为 URI 搜索格式?

2.如何轻松将SOLR查询转换为ES格式?

如果您帮我将上述查询字符串转换为URI 搜索格式,那么将我现有的复杂 SOLR 查询转换为 ES 查询将大有帮助。

注意:我可以使用?q=参数转换基本的CRUD操作,但很难转换其他操作,如 facet、boosting、group 等。

编辑:实际上我想说这个查询参数返回相同的文档数。都来自 solr 和 es - 在这里我只是将_source用于 ES,因为我们将fl用于 SOLR。否则一切都一样

https://my_host/rental_properties/_search?_source=id,code:feed_provider_id,feed_provider_id,feed,property_name,pax:occupancy,bedroom_count,min_stay,star_rating,night_rate_min,currency&q=feed:11 AND -booked_date:[2018-02- 23T00:00:00Z TO 2018-02-26T00:00:00Z] AND min_stay:[* TO 3] AND occupancy:[3 TO *] AND -latlon:0.001,0.001

Val的回答中,我了解到1 我可以轻松地使用相同的查询字符串进行 URI 搜索。2 . 但是如何轻松地将我的 SOLR 查询转换为 ES 格式?

Val*_*Val 5

请注意,通过将 DSL 查询放在source查询参数中,始终可以使用与 URI 搜索完全相同的 DSL 查询。您还需要添加source_content_type=application/json参数。所以你的查询看起来像这样:

GET my_index/_search?source_content_type=application/json&source={"query":{"geo_bounding_box":{"location":{"top_left":{"lat":42,"lon":-72},"bottom_right":{"lat":40,"lon":-74}}}}}
Run Code Online (Sandbox Code Playgroud)