c# - 将所有查询与弹性搜索索引匹配
问题描述
看着这个,我想知道是否也可以简单地通过字符串搜索索引,例如:
Hello World
并接收未绑定到显式实体的数据。一些伪代码:
var searchResponse = client.Search(MatchAllQuery ...?, index=someIndex, q="Hello World")
解决方案
你可以试试这个:
var searchResponse = client.Search<Document>(sd => sd
.Index("index_name")
.Type("type")
.Size(10000)
.Query(q => q
.Match(m => m.Field("TextID").Query("Hello World")
)));
推荐阅读
- google-cloud-platform - Firebase 存储是否允许通过签名 URL 上传?
- arrays - 如何在 Firebase 中不使用 foreach 插入多个数组
- python - Python:打印时如何换行?
- mysql - 如何求和汇总值并获得百分比?
- routes - Kong API网关路由的目的是什么
- php - 如何使用 fputcsv 和 explode 以分隔格式获取循环数据
- spring-boot - 有什么方法可以使用 spring-boot 自定义验证来使用两个自定义错误消息?
- css - 如何在 div 上正确定位垂直方向的文本?
- julia - 在 Julia 语言中理解步骤不能是零错误?
- c# - 如何将持久性数据添加到邮件项,使其对用户不可见