ElasticSearch (五) Postman查询数据

match_all

size

from size

match

返回指定字段

排序-sort

range

wildcard查询

合并查询语句

 

1. match_all

    --匹配所有文档

match_all

下面为查询结果

result

size

例如如上在没有设置size的情况下默认查询出只有十条document

 

size

那么当我们需要查询出多余十条或者指定条数的数据呢,

例如如下,我们只查询出三条数据

 

size 3

 

from size

如果我们要查找第三条到第十条的数据,可以用from size

 

from size

match

match用来查询某个字段是否包含需要查询的内容

 

match

可以看到查询的结果的第二条为"firstname":"Burton Alice",为什么会查出此条信息呢,是因为match是知道分词器的存在的,match在查询时会报firstname中的值分为Burton 和Alice。

返回指定字段

按照上面的查询返回的时所有字段的内容,即select * from table

如果我们只需要查看firstname和age的之呢,即我们需要得到select firstname,age from table

 

_source

排序 - sort

以下是对account_number字段按照降序排序

sort

range

range from to 

例如下面查找account_number 从938到948的数据(938<=account_number<=948),并且按照从大到小排序

 

Range

上面查到的时938<=account_number<=948,如果需要查找938<account_number<948呢

 

range

wildcard查询

允许使用通配符*和?来进行查询

*代表0个或多个字符

?代表任意一个字符

查找email以burton开头的document

wildcard

filter查询

filter查询的速度一般比较快

Filter

bool过滤查询

可以实现组合过滤查询

格式:

bool

例如如下查询

match_all

size

from size

match

返回指定字段

排序-sort

range

wildcard查询

合并查询语句

 

1. match_all

    --匹配所有文档

match_all

下面为查询结果

result

size

例如如上在没有设置size的情况下默认查询出只有十条document

 

size

那么当我们需要查询出多余十条或者指定条数的数据呢,

例如如下,我们只查询出三条数据

 

size 3

 

from size

如果我们要查找第三条到第十条的数据,可以用from size

 

from size

match

match用来查询某个字段是否包含需要查询的内容

 

match

可以看到查询的结果的第二条为"firstname":"Burton Alice",为什么会查出此条信息呢,是因为match是知道分词器的存在的,match在查询时会报firstname中的值分为Burton 和Alice。

返回指定字段

按照上面的查询返回的时所有字段的内容,即select * from table

如果我们只需要查看firstname和age的之呢,即我们需要得到select firstname,age from table

 

_source

排序 - sort

以下是对account_number字段按照降序排序

sort

range

range from to 

例如下面查找account_number 从938到948的数据(938<=account_number<=948),并且按照从大到小排序

 

Range

上面查到的时938<=account_number<=948,如果需要查找938<account_number<948呢

 

range

wildcard查询

允许使用通配符*和?来进行查询

*代表0个或多个字符

?代表任意一个字符

查找email以burton开头的document

wildcard

filter查询

filter查询的速度一般比较快

Filter

bool过滤查询

可以实现组合过滤查询

格式:

bool

例如如下查询

 

match_all

size

from size

match

返回指定字段

排序-sort

range

wildcard查询

合并查询语句

 

1. match_all

    --匹配所有文档

match_all

下面为查询结果

result

size

例如如上在没有设置size的情况下默认查询出只有十条document

 

size

那么当我们需要查询出多余十条或者指定条数的数据呢,

例如如下,我们只查询出三条数据

 

size 3

 

from size

如果我们要查找第三条到第十条的数据,可以用from size

 

from size

match

match用来查询某个字段是否包含需要查询的内容

 

match

可以看到查询的结果的第二条为"firstname":"Burton Alice",为什么会查出此条信息呢,是因为match是知道分词器的存在的,match在查询时会报firstname中的值分为Burton 和Alice。

返回指定字段

按照上面的查询返回的时所有字段的内容,即select * from table

如果我们只需要查看firstname和age的之呢,即我们需要得到select firstname,age from table

 

_source

排序 - sort

以下是对account_number字段按照降序排序

sort

range

range from to 

例如下面查找account_number 从938到948的数据(938<=account_number<=948),并且按照从大到小排序

 

Range

上面查到的时938<=account_number<=948,如果需要查找938<account_number<948呢

 

range

wildcard查询

允许使用通配符*和?来进行查询

*代表0个或多个字符

?代表任意一个字符

查找email以burton开头的document

wildcard

filter查询

filter查询的速度一般比较快

Filter

bool过滤查询

可以实现组合过滤查询

格式:

 

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

xuxizhou1994

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值