ES多条件,调用插件,复杂查询

{
  "query": {
    "function_score": {
      "query": {
        "bool": {
          "must": [
            {
              "bool": {
                "must": [
                  {
                    "bool": {
                      "should": [
                        {
                          "term": {
                            "area_id": "000003"
                          }
                        },
                        {
                          "term": {
                            "area_id": "000035"
                          }
                        }
                      ]
                    }
                  },
                  {
                    "bool": {
                      "should": [
                        {
                          "term": {
                            "star": "5"
                          }
                        },
                        {
                          "term": {
                            "is_must_sell ": "1"
                          }
                        }
                      ]
                    }
                  },
                  {
                    "bool": {
                      "should": [
                        {
                          "term": {
                            "house_type": "一室一厅"
                          }
                        },
                        {
                          "term": {
                            "house_type": "两室"
                          }
                        }
                      ]
                    }
                  }
                ]
              }
            },
            {
              "bool": {
                "must": [
                  {
                    "term": {
                      "rs_type": "1"
                    }
                  },
                  {
                    "range": {
                      "total_price": {
                        "gt": "3000.00",
                        "lt": "5000.00"
                      }
                    }
                  },
                  {
                    "term": {
                      "city_id": "000002"
                    }
                  }
                ]
              }
            },
            {
              "bool": {
                "must_not": [
                  {
                    "term": {
                      "others": "2"
                    }
                  },
                  {
                    "term": {
                      "layer_type": "低楼层"
                    }
                  },
                  {
                    "term": {
                      "has_elevator": "0"
                    }
                  },
                  {
                    "term": {
                      "orientation_name": "朝西"
                    }
                  },
                  {
                    "term": {
                      "orientation_name": "朝北"
                    }
                  }
                ]
              }
            }
          ]
        }
      },
      "functions": [
        {
          "script_score": {
            "script": {
              "source": "houseMatch_df",
              "lang": "houseMatch",
              "params": {
                "furniture_name": "不限",
                "yx_place": [
                  {
                    "areaCode": "000003",
                    "cityCode": "000002",
                    "placeCode": "0"
                  },
                  {
                    "areaCode": "000035",
                    "cityCode": "000002",
                    "placeCode": "0"
                  }
                ],
                "house_type": [
                  "一室一厅",
                  "两室"
                ],
                "fitment_type": [
                  "简装"
                ]
              }
            }
          }
        }
      ],
      "boost_mode": "replace"
    }
  },
  "from": "0",
  "size": "1",
  "sort": [],
  "aggs": {}
}

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值