Elasticsearch api查询

  1. http://localhost:9200/channel/details/_search > 查询所有的数据,相当于不带条件查询
channel:索引
details:类型
{
    "took": 4,
    "timed_out": false,
    "_shards": {
        "total": 5,
        "successful": 5,
        "failed": 0
    },
    "hits": {
        "total": 796,
        "max_score": 1,
        "hits": [
            {
                "_index": "channel",
                "_type": "details",
                "_id": "AV02WSEi_aivDXwC7DCj",
                "_score": 1,
                "_source": {//ES将原始数据保存到_source字段中
                    "id": 654,
                    "api_id": "us-t",
                    "type": 1,
                    "type_id": "26"
                }
            },
            {
                "_index": "channel",
                "_type": "details",
                "_id": "AV02WSEi_aivDXwC7DCk",
                "_score": 1,
                "_source": {
                    "id": 655,
                    "api_id": "us-e",
                    "type": 1,
                    "type_id": "26"
                }
            },
            {
                "_index": "channel",
                "_type": "details",
                "_id": "AV02WSEi_aivDXwC7DCq",
                "_score": 1,
                "_source": {
                    "id": 661,
                    "api_id": "tw-t",
                    "type": 1,
                    "type_id": "26"
                }
            },
            {
                "_index": "channel",
                "_type": "details",
                "_id": "AV02WSEi_aivDXwC7DCy",
                "_score": 1,
                "_source": {
                    "id": 669,
                    "api_id": "in-t",
                    "type": 1,
                    "type_id": "26"
                }
            },
            {
                "_index": "channel",
                "_type": "details",
                "_id": "AV02WSEi_aivDXwC7DC1",
                "_score": 1,
                "_source": {
                    "id": 672,
                    "api_id": "in-snc",
                    "type": 1,
                    "type_id": "26"
                }
            },
            {
                "_index": "channel",
                "_type": "details",
                "_id": "AV02WSEi_aivDXwC7DC3",
                "_score": 1,
                "_source": {
                    "id": 674,
                    "api_id": "in-y",
                    "type": 1,
                    "type_id": "26"
                }
            },
            {
                "_index": "channel",
                "_type": "details",
                "_id": "AV02WSEi_aivDXwC7DDH",
                "_score": 1,
                "_source": {
                    "id": 690,
                    "api_id": "ru-n",
                    "type": 1,
                    "type_id": "26"
                }
            },
            {
                "_index": "channel",
                "_type": "details",
                "_id": "AV02WSEi_aivDXwC7DDI",
                "_score": 1,
                "_source": {
                    "id": 691,
                    "api_id": "ru-b",
                    "type": 1,
                    "type_id": "26"
                }
            },
            {
                "_index": "channel",
                "_type": "details",
                "_id": "AV02WSEi_aivDXwC7DDR",
                "_score": 1,
                "_source": {
                    "id": 700,
                    "api_id": "ru-snc",
                    "type": 1,
                    "type_id": "26"
                }
            },
            {
                "_index": "channel",
                "_type": "details",
                "_id": "AV02WSEi_aivDXwC7DDS",
                "_score": 1,
                "_source": {
                    "id": 701,
                    "api_id": "ru-economy",
                    "type": 1,
                    "type_id": "26"
                }
            }
        ]
    }
}

你会发现无论数据量有多大,每次最多只能查到10条数据。这是因为ES服务端默认对查询结果做了分页处理,每页默认的大小为10

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值