ElasticSearch中如何让query should等同于filter should
来源:互联网 发布:淘宝客活动广场靠谱吗 编辑:程序博客网 时间:2024/06/08 08:49
bool query
must
The clause (query) must appear in matching documents.
should
The clause (query) should appear in the matching document. In a boolean query with no must
clauses, one or more should
clauses must match a document. The minimum number of should clauses to match can be set using the minimum_should_match
parameter.
must_not
The clause (query) must not appear in the matching documents.
The bool query also supports disable_coord
parameter (defaults to false
). Basically the coord similarity computes a score factor based on the fraction of all query terms that a document contains. See Lucene BooleanQuery
for>{
"bool" : {
"must" : {
"term" : { "user" : "kimchy" }
},
"must_not" : {
"range" : {
"age" : { "from" : 10, "to" : 20 }
}
},
"should" : [
{
"term" : { "tag" : "wow" }
},
{
"term" : { "tag" : "elasticsearch" }
}
],
"minimum_should_match" : 1,
"boost" : 1.0
}
}
本文出自:
http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/query-dsl-bool-query.html
minimum_should_match 使用效果:bool query 中的should条件会过滤,相当于bool filter中should;且只能紧跟bool query中的should后面使用,其它位置会报异常
- ElasticSearch中如何让query should等同于filter should
- ElasticSearch中Filter和Query的异同
- ElasticSearch中Filter和Query的异同
- elasticsearch must mustnot should 构建工具类
- Elasticsearch DSL中Query与Filter的区别
- Elasticsearch DSL中Query与Filter的不同
- Elasticsearch DSL中Query与Filter的不同
- Elasticsearch DSL中Query与Filter的不同
- elasticsearch query dsl url中如何使用
- Elasticsearch之query与filter
- elasticsearch中如何高效的使用filter
- elasticsearch中如何高效的使用filter
- When executing a query what a callback function should be
- Elasticsearch 之 query与filter区别
- Elasticsearch的DSL之query and filter
- ElasticSearch的 Query DSL 和 Filter DSL
- ElasticSearch的 Query DSL 和 Filter DSL
- Java - Hibernate Tools Query property should be explicitly set for Query Exporter?
- 共享存储容灾数据保护 RAID
- C# 并行线程探讨
- 一件激活码泄露事故的发现过程和反思
- MFC消息处理
- 多点触控术语
- ElasticSearch中如何让query should等同于filter should
- 采药
- 捕捉Power键的长按与短按处理
- C# webBrowser控件 不再新窗口打开链接方法
- C#利用zxing.net操作二维码和条形码
- 线程的并发
- 算法复杂度分析
- java中的io系统详解
- C#中ExecuteReader()、ExecuteNonQuery()、ExecuteScalar()方法的作用