当前位置:网站首页>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 .
边栏推荐
- 从pair到unordered_map,理论+leetcode题目实战
- Data sharing between laravel lower views
- An accident caused by a MySQL misoperation, and the "high availability" cannot withstand it!
- Common sense knowledge points
- Six stones Management: garbage dump effect: if you don't manage your work, you will become a garbage dump
- Low fidelity prototype vs high fidelity prototype, which one is more suitable for your design?
- GO语言并发模型-MPG模型
- Carry forward the fine style of continuous operation and go all out to ensure the safety of Beijiang Levee
- Do you really know the difference between H5 and applet?
- The "little giant" specialized in special new products is restarted, and the "enterprise cloud" digital empowerment
猜你喜欢

测试 H5 和小程序的区别,你真的知道吗?

Laravel8 uses faker to call factory to fill data

常见的缺陷管理工具——禅道,从安装到使用手把手教会你

A common defect management tool - Zen, which teaches you from installation to using the handle

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

A brief introduction to the lexical analysis of PostgreSQL
Step by step introduction to sqlsugar based development framework (9) -- Realizing field permission control with WinForm control

postgresql之词法分析简介

Laravel 8 realizes auth login
Oracle RAC configuration multipathing
随机推荐
Istio Troubleshooting: using istio to reserve ports causes pod startup failure
Which account of Dongfang fortune is safer and better
Concurrent writing of maps in golang
FPGA based analog I ² C protocol system design (medium)
Redis highly available
I have been in the industry for 4 years and have changed jobs twice. I have learned a lot about software testing
Is it safe to open an account for stock speculation in the top ten securities app rankings in China
Go language -init() function - package initialization
leetcode. 12 --- integer to Roman numeral
Design of vga/lcd display controller system based on FPGA (Part 1)
Two way combination of business and technology to build a bank data security management system
box-sizing
Bitmap of redis data structure
Chapter 8 operation bit and bit string (4)
R语言构建回归模型诊断(正态性无效)、进行变量变换、使用car包中的powerTransform函数对目标变量进行Box-Cox变换(Box–Cox transform to normality)
股票开户要找谁?在线开户安全么?
股票网上开户及开户流程怎样?网上开户安全么?
R language plot visualization: use plot to visualize the training set and test set after data division, use different shape label representation, training set, test set, and display training and test
Who do you want to open a stock account? Is online account opening safe?
FPGA based analog I ² C protocol system design (Part I)