当前位置:   article > 正文

es filter中使用should_es filter should

es filter should
  1. 搜索 state = 0 或者 state不存在的记录
  2. {
  3. "query": {
  4. "bool": {
  5. "filter": {
  6. "bool": {
  7. "should": [
  8. { "term": { "state": 0 } },
  9. { "bool": { "must_not": { "exists": { "field": "state" } } } }
  10. ]
  11. }
  12. }
  13. }
  14. }
  15. },

 

 

  1. 搜索 (state = 0 或者 state不存在的记录) and payState = 1 :这句有待验证
  2. {
  3. query: {
  4. bool: {
  5. filter: [{
  6. "bool": {
  7. "should": [
  8. { "term": { "state": 0 } },
  9. { "bool": { "must_not": { "exists": { "field": "state" } } } }
  10. ]
  11. }
  12. },
  13. { term: { payState: 1 } }
  14. ]
  15. }
  16. }
  17. }
声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/小惠珠哦/article/detail/750674
推荐阅读
相关标签
  

闽ICP备14008679号