返回 account_number|学习笔记

简介: 快速学习返回 account_number。

开发者学堂课程【ElasticSearch 最新快速入门教程返回 account_number】学习笔记,与课程紧密联系,让用户快速学习知识。

课程地址:https://developer.aliyun.com/learning/course/642/detail/10675


返回 account_number

 

内容介绍:

一、返回 account_number=20

二、address=mill

三、address=mill lane

四、短语搭配 address=mill lane

 

一、返回 account_number=20

curl-XPOST’localhost:9200/bank/search?pretty’-d

‘{

“query”:{match_all”:{}},

“source”:{{“balance”,”account_number”}}

}’

match 查询,可以作为基本字段搜索查询

返回account_number=20:

curl-XPOST’localhost:9200/bank/_search?pretty’-d

‘{

“query”:{“match”:{“account_number”:20}},

}’

查询代码:

{

“query”:{

“match": {

“account_number”:20

}

},

“_source”:{

“_score”,

“balance”

“account_number”

},

“sort”:{

"balance": {

“order":”desc”

}

}

}

查询结果:

image.png

{

"took":111,

"timed_out": false,

“_shards":{

"total":5,

"successful": 5,

"skipped": 0,

"failed":0

},

"hits":{

"total": 1,

"max_score": null,

"hits":{

{

"_index": "bank",

“_type":"account"

“_id":"20",

“_score": null,

“_source":{

"account_number":20,

"balance":16418

}

"sort";{

16418

}

查询所有的,代码如下:

{

“query”:{

“match": {

“account_number”:20

}

},

“sort”:{

"balance": {

“order":”desc”

}

}

}

查询结果:

image.png


二、返回 address=mill

curl-XPOST’localhost:9200/bank/search?pretty’-d

‘{

“query”:{match_all”:{}},

“source”:{{“balance”,”account_number”}}

}’

返回address=mill

curl-XPOST’localhost:9200/bank/_search?pretty’-d

‘{

“query”:{“match”:{“address”:”mill”}},

}

查询代码:

“query”:{

“match": {

“address”:”mill”

}

},

“sort”:{

"balance": {

“order":”desc”

}

}

}

查询结果:

image.png


三、返回 address=mill or address=lane

curl-XPOST’localhost:9200/bank/search?pretty’-d

‘{

“query”:{match_all”:{}},

“source”:{{“balance”,”account_number”}}

}’

返回 address=mill or address=lane

curl-XPOST’localhost:9200/bank/_search?pretty’-d

‘{

“query”:{“match”:{“address”:”mill lane”}},

}

查询代码1:

“query”:{

“match": {

“address”:”mill lane”

}

},

“sort”:{

"balance": {

“order":”desc”

}

}

}

查询结果:

image.png

查询代码2:

“query”:{

“match": {

“address”:”mill lane”

}

},

“sort”:{

"balance": {

“order":”desc”

}

},

“size”:200

}

查询结果:

image.png

 

四、返回 短语搭配 address=mill lane

curl-XPOST’localhost:9200/bank/search?pretty’-d

‘{

“query”:{match_all”:{}},

“_source”:{“balance”,”account_number”}

}’

返回 短语搭配 address=mill lane

curl-XPOST’localhost:9200/bank/_search?pretty’-d

‘{

“query”:{“match_phrase”:{“address”:”mill lane”}},

}

查询代码:

“query”:{

“match": {

“address”:”mill lane”

}

},

“sort”:{

"balance": {

“order":”desc”

}

},

“size”:200

“_source”:{

“balance”,

”account_number”

}

}

查询结果:

image.png

相关文章
|
4天前
|
数据采集 人工智能 安全
|
13天前
|
云安全 监控 安全
|
5天前
|
自然语言处理 API
万相 Wan2.6 全新升级发布!人人都能当导演的时代来了
通义万相2.6全新升级,支持文生图、图生视频、文生视频,打造电影级创作体验。智能分镜、角色扮演、音画同步,让创意一键成片,大众也能轻松制作高质量短视频。
1111 152
|
18天前
|
机器学习/深度学习 人工智能 自然语言处理
Z-Image:冲击体验上限的下一代图像生成模型
通义实验室推出全新文生图模型Z-Image,以6B参数实现“快、稳、轻、准”突破。Turbo版本仅需8步亚秒级生成,支持16GB显存设备,中英双语理解与文字渲染尤为出色,真实感和美学表现媲美国际顶尖模型,被誉为“最值得关注的开源生图模型之一”。
1787 9
|
10天前
|
人工智能 自然语言处理 API
一句话生成拓扑图!AI+Draw.io 封神开源组合,工具让你的效率爆炸
一句话生成拓扑图!next-ai-draw-io 结合 AI 与 Draw.io,通过自然语言秒出架构图,支持私有部署、免费大模型接口,彻底解放生产力,绘图效率直接爆炸。
711 152
|
12天前
|
人工智能 安全 前端开发
AgentScope Java v1.0 发布,让 Java 开发者轻松构建企业级 Agentic 应用
AgentScope 重磅发布 Java 版本,拥抱企业开发主流技术栈。
666 14
|
7天前
|
SQL 自然语言处理 调度
Agent Skills 的一次工程实践
**本文采用 Agent Skills 实现整体智能体**,开发框架采用 AgentScope,模型使用 **qwen3-max**。Agent Skills 是 Anthropic 新推出的一种有别于mcp server的一种开发方式,用于为 AI **引入可共享的专业技能**。经验封装到**可发现、可复用的能力单元**中,每个技能以文件夹形式存在,包含特定任务的指导性说明(SKILL.md 文件)、脚本代码和资源等 。大模型可以根据需要动态加载这些技能,从而扩展自身的功能。目前不少国内外的一些框架也开始支持此种的开发方式,详细介绍如下。
475 5