elasticsearch通用查询参数

本文介绍了Elasticsearch的一些通用查询参数,如pretty用于美化查询结果,format控制返回数据格式,human使得数值更易读,filter_path筛选返回字段,flat_settings影响设置呈现,以及error_trace用于开启错误堆栈追踪。

Elasticsearch提供了一些通用查询参数,可以用于所有REST API的查询使用

1.pretty

是否美观的显示查询结果,即对JSON数据进行格式化显示

普通请求:

GET /spring-elasticsearch-demo/_search HTTP/1.1
Host: localhost:9200
cache-control: no-cache
Postman-Token: 50167740-fc2b-492e-be16-51e760426094

{"took":2,"timed_out":false,"_shards":{"total":5,"successful":5,"skipped":0,"failed":0},"hits":{"total":1,"max_score":1.0,"hits":[{"_index":"spring-elasticsearch-demo","_type":"person","_id":"2","_score":1.0,"_source":{"id":"2","name":"大大","description":"天天向上","age":1,"create":1535760000000}}]}}

此时,JSON数据是没有任何空格、缩进的

pretty请求:

GET /spring-elasticsearch-demo/_search?pretty HTTP/1.1
Host: localhost:9200
cache-control: no-cache
Postman-Token: 8a70e5d8-b674-4
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值