当前位置:网站首页>Es search content top
Es search content top
2022-06-24 15:16:00 【Mongolia Shangdan 2】
Sometimes , We may need human intervention ES Search results for , Put the specified content at the top ,ES Provides pinned Syntax to implement this function .
GET article_search/_search
{
"query" : {
"pinned":{
"ids" : ["1234567"],
"organic": {
"match" : {
"title": " Making clouds "
}
}
}
},
"size" : 10,
"from" : 0
}pinned Inside ids Represents the document to be placed at the top id list .
organic Is an arbitrary query statement . We can replace it with a complex query :
GET article_search/_search
{
"query" : {
"pinned":{
"ids" : ["1234567"],
"organic": {
"bool" : {
"should" : [
{
"match_phrase" : {
"title" : {
"query" : " Making clouds ",
"boost" : 2,
"slop" : 4
}
}
},
{
"multi_match" : {
"query" : " Making clouds ",
"type" : "best_fields",
"fields" : ["title", "plain"],
"minimum_should_match" : "20%",
"boost" : 1
}
}
],
"minimum_should_match" : 1
}
}
}
},
"size" : 10,
"from" : 0
}Look at the document and say it seems to be from ES 7.4 This syntax is supported in version .
边栏推荐
- 【ansible问题处理】远程执行用户环境变量加载问题
- golang中Map的并发写入
- laravel8使用faker调用工厂填充数据
- 从pair到unordered_map,理论+leetcode题目实战
- [pytoch] quantification
- Development of digital Tibetan product system NFT digital Tibetan product system exception handling source code sharing
- Oracle RAC configuration multipathing
- Carry forward the fine style of continuous operation and go all out to ensure the safety of Beijiang Levee
- ESP32系列--ESP32各个系列对比
- leetcode.12 --- 整数转罗马数字
猜你喜欢

`Thymeleaf ` template engine comprehensive analysis

Application of motion capture system in positioning and mapping of mobile robot in underground tunnel

Multimeter resistance measurement diagram and precautions

Overview of SAP marketing cloud functions (IV)

API data interface for announcement of Hong Kong listed companies

Stm32f1 and stm32cubeide programming examples -ws2812b full color LED driver (based on spi+dma)

I have been in the industry for 4 years and have changed jobs twice. I have learned a lot about software testing

GO语言-goroutine协程的使用

Left hand code, right hand open source, part of the open source road

动作捕捉系统用于地下隧道移动机器人定位与建图
随机推荐
Overview of SAP marketing cloud functions (IV)
When installing Wireshark, npcap cannot be installed successfully. It is recommended to use WinPcap first
安装wireshark时npcap怎么都安装不成功,建议先用winpcap
探索云原生数据库,纵观未来科技发展
IDEA 插件 Material Theme UI收费后的办法
VIM common shortcut keys
测试 H5 和小程序的区别,你真的知道吗?
Is it safe to open a stock account by mobile phone
leetcode.12 --- 整数转罗马数字
兴业证券靠谱吗?开证券账户安全吗?
Which account of Dongfang fortune is safer and better
Record the range of data that MySQL update will lock
Chapter 8 operation bit and bit string (4)
openinstall携手书链:助力渠道数据分析,共创书联网时代
A simple and powerful developer toolkit box3 cc
GO语言-init()函数-包初始化
golang中Map的并发写入
09_ An efficient memory method
GO语言-goroutine协程的使用
Concurrent writing of maps in golang