商城项目商品检索使用ES验证保存的商品信息-----商城项目

{
  "took" : 2,
  "timed_out" : false,
  "_shards" : {
    "total" : 1,
    "successful" : 1,
    "skipped" : 0,
    "failed" : 0
  },
  "hits" : {
    "total" : {
      "value" : 14,
      "relation" : "eq"
    },
    "max_score" : 0.036922477,
    "hits" : [
      {
        "_index" : "product",
        "_type" : "_doc",
        "_id" : "3",
        "_score" : 0.036922477,
        "_source" : {
          "attrs" : [ ],
          "brandId" : 1,
          "brandImg" : "https://i-blog.csdnimg.cn/direct/d320a4af53644f28ae64586604f14c9f.png",
          "brandName" : "华为",
          "catalogId" : 225,
          "catalogName" : "手机",
          "hasStock" : true,
          "hotScore" : 0,
          "saleCount" : 0,
          "skuId" : 3,
          "skuImg" : "https://i-blog.csdnimg.cn/direct/d320a4af53644f28ae64586604f14c9f.png",
          "skuPrice" : 6999.0,
          "skuTitle" : "华为 Mate30 PRO 星河银 8GB+256GB",
          "spuId" : 10
        }
      },
      {
        "_index" : "product",
        "_type" : "_doc",
        "_id" : "4",
        "_score" : 0.036922477,
        "_source" : {
          "attrs" : [ ],
          "brandId" : 1,
          "brandImg" : "https://i-blog.csdnimg.cn/direct/d320a4af53644f28ae64586604f14c9f.png",
          "brandName" : "华为",
          "catalogId" : 225,
          "catalogName" : "手机",
          "hasStock" : true,
          "hotScore" : 0,
          "saleCount" : 0,
          "skuId" : 4,
          "skuImg" : "https://i-blog.csdnimg.cn/direct/d320a4af53644f28ae64586604f14c9f.png",
          "skuPrice" : 5499.0,
          "skuTitle" : "华为 Mate30 PRO 星河银 6GB+128GB",
          "spuId" : 10
        }
      },
      {
        "_index" : "product",
        "_type" : "_doc",
        "_id" : "5",
        "_score" : 0.036922477,
        "_source" : {
          "attrs" : [ ],
          "brandId" : 1,
          "brandImg" : "https://i-blog.csdnimg.cn/direct/d320a4af53644f28ae64586604f14c9f.png",
          "brandName" : "华为",
          "catalogId" : 225,
          "catalogName" : "手机",
          "hasStock" : true,
          "hotScore" : 0,
          "saleCount" : 0,
          "skuId" : 5,
          "skuImg" : "https://i-blog.csdnimg.cn/direct/d320a4af53644f28ae64586604f14c9f.png",
          "skuPrice" : 5999.0,
          "skuTitle" : "华为 Mate30 PRO 星河银 8GB+128GB",
          "spuId" : 10
        }
      },
      {
        "_index" : "product",
        "_type" : "_doc",
        "_id" : "6",
        "_score" : 0.036922477,
        "_source" : {
          "attrs" : [ ],
          "brandId" : 1,
          "brandImg" : "https://i-blog.csdnimg.cn/direct/d320a4af53644f28ae64586604f14c9f.png",
          "brandName" : "华为",
          "catalogId" : 225,
          "catalogName" : "手机",
          "hasStock" : true,
          "hotScore" : 0,
          "saleCount" : 0,
          "skuId" : 6,
          "skuImg" : "https://i-blog.csdnimg.cn/direct/d320a4af53644f28ae64586604f14c9f.png",
          "skuPrice" : 6999.0,
          "skuTitle" : "华为 Mate30 PRO 亮黑色 8GB+256GB",
          "spuId" : 10
        }
      },
      {
        "_index" : "product",
        "_type" : "_doc",
        "_id" : "7",
        "_score" : 0.036922477,
        "_source" : {
          "attrs" : [ ],
          "brandId" : 1,
          "brandImg" : "https://i-blog.csdnimg.cn/direct/d320a4af53644f28ae64586604f14c9f.png",
          "brandName" : "华为",
          "catalogId" : 225,
          "catalogName" : "手机",
          "hasStock" : true,
          "hotScore" : 0,
          "saleCount" : 0,
          "skuId" : 7,
          "skuImg" : "https://i-blog.csdnimg.cn/direct/d320a4af53644f28ae64586604f14c9f.png",
          "skuPrice" : 5499.0,
          "skuTitle" : "华为 Mate30 PRO 亮黑色 6GB+128GB",
          "spuId" : 10
        }
      },
      {
        "_index" : "product",
        "_type" : "_doc",
        "_id" : "8",
        "_score" : 0.036922477,
        "_source" : {
          "attrs" : [ ],
          "brandId" : 1,
          "brandImg" : "https://i-blog.csdnimg.cn/direct/d320a4af53644f28ae64586604f14c9f.png",
          "brandName" : "华为",
          "catalogId" : 225,
          "catalogName" : "手机",
          "hasStock" : false,
          "hotScore" : 0,
          "saleCount" : 0,
          "skuId" : 8,
          "skuImg" : "https://i-blog.csdnimg.cn/direct/d320a4af53644f28ae64586604f14c9f.png",
          "skuPrice" : 5999.0,
          "skuTitle" : "华为 Mate30 PRO 亮黑色 8GB+128GB",
          "spuId" : 10
        }
      },
      {
        "_index" : "product",
        "_type" : "_doc",
        "_id" : "9",
        "_score" : 0.036922477,
        "_source" : {
          "attrs" : [ ],
          "brandId" : 1,
          "brandImg" : "https://i-blog.csdnimg.cn/direct/d320a4af53644f28ae64586604f14c9f.png",
          "brandName" : "华为",
          "catalogId" : 225,
          "catalogName" : "手机",
          "hasStock" : false,
          "hotScore" : 0,
          "saleCount" : 0,
          "skuId" : 9,
          "skuImg" : "https://i-blog.csdnimg.cn/direct/d320a4af53644f28ae64586604f14c9f.png",
          "skuPrice" : 6999.0,
          "skuTitle" : "华为 Mate30 PRO 罗兰紫 8GB+256GB",
          "spuId" : 10
        }
      },
      {
        "_index" : "product",
        "_type" : "_doc",
        "_id" : "10",
        "_score" : 0.036922477,
        "_source" : {
          "attrs" : [ ],
          "brandId" : 1,
          "brandImg" : "https://i-blog.csdnimg.cn/direct/d320a4af53644f28ae64586604f14c9f.png",
          "brandName" : "华为",
          "catalogId" : 225,
          "catalogName" : "手机",
          "hasStock" : false,
          "hotScore" : 0,
          "saleCount" : 0,
          "skuId" : 10,
          "skuImg" : "https://i-blog.csdnimg.cn/direct/d320a4af53644f28ae64586604f14c9f.png",
          "skuPrice" : 5499.0,
          "skuTitle" : "华为 Mate30 PRO 罗兰紫 6GB+128GB",
          "spuId" : 10
        }
      },
      {
        "_index" : "product",
        "_type" : "_doc",
        "_id" : "11",
        "_score" : 0.036922477,
        "_source" : {
          "attrs" : [ ],
          "brandId" : 1,
          "brandImg" : "https://i-blog.csdnimg.cn/direct/d320a4af53644f28ae64586604f14c9f.png",
          "brandName" : "华为",
          "catalogId" : 225,
          "catalogName" : "手机",
          "hasStock" : false,
          "hotScore" : 0,
          "saleCount" : 0,
          "skuId" : 11,
          "skuImg" : "https://i-blog.csdnimg.cn/direct/d320a4af53644f28ae64586604f14c9f.png",
          "skuPrice" : 5999.0,
          "skuTitle" : "华为 Mate30 PRO 罗兰紫 8GB+128GB",
          "spuId" : 10
        }
      },
      {
        "_index" : "product",
        "_type" : "_doc",
        "_id" : "12",
        "_score" : 0.03485206,
        "_source" : {
          "attrs" : [ ],
          "brandId" : 1,
          "brandImg" : "https://i-blog.csdnimg.cn/direct/d320a4af53644f28ae64586604f14c9f.png",
          "brandName" : "华为",
          "catalogId" : 225,
          "catalogName" : "手机",
          "hasStock" : false,
          "hotScore" : 0,
          "saleCount" : 0,
          "skuId" : 12,
          "skuImg" : "https://i-blog.csdnimg.cn/direct/d320a4af53644f28ae64586604f14c9f.png",
          "skuPrice" : 6999.0,
          "skuTitle" : "华为 Mate30 PRO 翡冷翠 8GB+256GB",
          "spuId" : 10
        }
      }
    ]
  }
}

{
  "took" : 2,
  "timed_out" : false,
  "_shards" : {
    "total" : 1,
    "successful" : 1,
    "skipped" : 0,
    "failed" : 0
  },
  "hits" : {
    "total" : {
      "value" : 14,
      "relation" : "eq"
    },
    "max_score" : 0.036922477,
    "hits" : [
      {
        "_index" : "product",
        "_type" : "_doc",
        "_id" : "3",
        "_score" : 0.036922477,
        "_source" : {
          "attrs" : [ ],
          "brandId" : 1,
          "brandImg" : "https://i-blog.csdnimg.cn/direct/d320a4af53644f28ae64586604f14c9f.png",
          "brandName" : "华为",
          "catalogId" : 225,
          "catalogName" : "手机",
          "hasStock" : true,
          "hotScore" : 0,
          "saleCount" : 0,
          "skuId" : 3,
          "skuImg" : "https://i-blog.csdnimg.cn/direct/d320a4af53644f28ae64586604f14c9f.png",
          "skuPrice" : 6999.0,
          "skuTitle" : "华为 Mate30 PRO 星河银 8GB+256GB",
          "spuId" : 10
        }
      },
      {
        "_index" : "product",
        "_type" : "_doc",
        "_id" : "4",
        "_score" : 0.036922477,
        "_source" : {
          "attrs" : [ ],
          "brandId" : 1,
          "brandImg" : "https://i-blog.csdnimg.cn/direct/d320a4af53644f28ae64586604f14c9f.png",
          "brandName" : "华为",
          "catalogId" : 225,
          "catalogName" : "手机",
          "hasStock" : true,
          "hotScore" : 0,
          "saleCount" : 0,
          "skuId" : 4,
          "skuImg" : "https://i-blog.csdnimg.cn/direct/d320a4af53644f28ae64586604f14c9f.png",
          "skuPrice" : 5499.0,
          "skuTitle" : "华为 Mate30 PRO 星河银 6GB+128GB",
          "spuId" : 10
        }
      },
      {
        "_index" : "product",
        "_type" : "_doc",
        "_id" : "5",
        "_score" : 0.036922477,
        "_source" : {
          "attrs" : [ ],
          "brandId" : 1,
          "brandImg" : "https://i-blog.csdnimg.cn/direct/d320a4af53644f28ae64586604f14c9f.png",
          "brandName" : "华为",
          "catalogId" : 225,
          "catalogName" : "手机",
          "hasStock" : true,
          "hotScore" : 0,
          "saleCount" : 0,
          "skuId" : 5,
          "skuImg" : "https://i-blog.csdnimg.cn/direct/d320a4af53644f28ae64586604f14c9f.png",
          "skuPrice" : 5999.0,
          "skuTitle" : "华为 Mate30 PRO 星河银 8GB+128GB",
          "spuId" : 10
        }
      },
      {
        "_index" : "product",
        "_type" : "_doc",
        "_id" : "6",
        "_score" : 0.036922477,
        "_source" : {
          "attrs" : [ ],
          "brandId" : 1,
          "brandImg" : "https://i-blog.csdnimg.cn/direct/d320a4af53644f28ae64586604f14c9f.png",
          "brandName" : "华为",
          "catalogId" : 225,
          "catalogName" : "手机",
          "hasStock" : true,
          "hotScore" : 0,
          "saleCount" : 0,
          "skuId" : 6,
          "skuImg" : "https://i-blog.csdnimg.cn/direct/d320a4af53644f28ae64586604f14c9f.png",
          "skuPrice" : 6999.0,
          "skuTitle" : "华为 Mate30 PRO 亮黑色 8GB+256GB",
          "spuId" : 10
        }
      },
      {
        "_index" : "product",
        "_type" : "_doc",
        "_id" : "7",
        "_score" : 0.036922477,
        "_source" : {
          "attrs" : [ ],
          "brandId" : 1,
          "brandImg" : "https://i-blog.csdnimg.cn/direct/d320a4af53644f28ae64586604f14c9f.png",
          "brandName" : "华为",
          "catalogId" : 225,
          "catalogName" : "手机",
          "hasStock" : true,
          "hotScore" : 0,
          "saleCount" : 0,
          "skuId" : 7,
          "skuImg" : "https://i-blog.csdnimg.cn/direct/d320a4af53644f28ae64586604f14c9f.png",
          "skuPrice" : 5499.0,
          "skuTitle" : "华为 Mate30 PRO 亮黑色 6GB+128GB",
          "spuId" : 10
        }
      },
      {
        "_index" : "product",
        "_type" : "_doc",
        "_id" : "8",
        "_score" : 0.036922477,
        "_source" : {
          "attrs" : [ ],
          "brandId" : 1,
          "brandImg" : "https://i-blog.csdnimg.cn/direct/d320a4af53644f28ae64586604f14c9f.png",
          "brandName" : "华为",
          "catalogId" : 225,
          "catalogName" : "手机",
          "hasStock" : false,
          "hotScore" : 0,
          "saleCount" : 0,
          "skuId" : 8,
          "skuImg" : "https://i-blog.csdnimg.cn/direct/d320a4af53644f28ae64586604f14c9f.png",
          "skuPrice" : 5999.0,
          "skuTitle" : "华为 Mate30 PRO 亮黑色 8GB+128GB",
          "spuId" : 10
        }
      },
      {
        "_index" : "product",
        "_type" : "_doc",
        "_id" : "9",
        "_score" : 0.036922477,
        "_source" : {
          "attrs" : [ ],
          "brandId" : 1,
          "brandImg" : "https://i-blog.csdnimg.cn/direct/d320a4af53644f28ae64586604f14c9f.png",
          "brandName" : "华为",
          "catalogId" : 225,
          "catalogName" : "手机",
          "hasStock" : false,
          "hotScore" : 0,
          "saleCount" : 0,
          "skuId" : 9,
          "skuImg" : "https://i-blog.csdnimg.cn/direct/d320a4af53644f28ae64586604f14c9f.png",
          "skuPrice" : 6999.0,
          "skuTitle" : "华为 Mate30 PRO 罗兰紫 8GB+256GB",
          "spuId" : 10
        }
      },
      {
        "_index" : "product",
        "_type" : "_doc",
        "_id" : "10",
        "_score" : 0.036922477,
        "_source" : {
          "attrs" : [ ],
          "brandId" : 1,
          "brandImg" : "https://i-blog.csdnimg.cn/direct/d320a4af53644f28ae64586604f14c9f.png",
          "brandName" : "华为",
          "catalogId" : 225,
          "catalogName" : "手机",
          "hasStock" : false,
          "hotScore" : 0,
          "saleCount" : 0,
          "skuId" : 10,
          "skuImg" : "https://i-blog.csdnimg.cn/direct/d320a4af53644f28ae64586604f14c9f.png",
          "skuPrice" : 5499.0,
          "skuTitle" : "华为 Mate30 PRO 罗兰紫 6GB+128GB",
          "spuId" : 10
        }
      },
      {
        "_index" : "product",
        "_type" : "_doc",
        "_id" : "11",
        "_score" : 0.036922477,
        "_source" : {
          "attrs" : [ ],
          "brandId" : 1,
          "brandImg" : "https://i-blog.csdnimg.cn/direct/d320a4af53644f28ae64586604f14c9f.png",
          "brandName" : "华为",
          "catalogId" : 225,
          "catalogName" : "手机",
          "hasStock" : false,
          "hotScore" : 0,
          "saleCount" : 0,
          "skuId" : 11,
          "skuImg" : "https://i-blog.csdnimg.cn/direct/d320a4af53644f28ae64586604f14c9f.png",
          "skuPrice" : 5999.0,
          "skuTitle" : "华为 Mate30 PRO 罗兰紫 8GB+128GB",
          "spuId" : 10
        }
      },
      {
        "_index" : "product",
        "_type" : "_doc",
        "_id" : "12",
        "_score" : 0.03485206,
        "_source" : {
          "attrs" : [ ],
          "brandId" : 1,
          "brandImg" : "https://i-blog.csdnimg.cn/direct/d320a4af53644f28ae64586604f14c9f.png",
          "brandName" : "华为",
          "catalogId" : 225,
          "catalogName" : "手机",
          "hasStock" : false,
          "hotScore" : 0,
          "saleCount" : 0,
          "skuId" : 12,
          "skuImg" : "https://i-blog.csdnimg.cn/direct/d320a4af53644f28ae64586604f14c9f.png",
          "skuPrice" : 6999.0,
          "skuTitle" : "华为 Mate30 PRO 翡冷翠 8GB+256GB",
          "spuId" : 10
        }
      }
    ]
  }
}
 

GET product/_search
{
  "query": {
    "bool": {
      "must": [
        {
          "match": {
            "skuTitle": "华为"
          }
        }
      ],
      "filter": [
        {
          "term": {
            "catalogId": "225"
          }
        },
        {
          "terms": {  
            "brandId": [
              "1", "2", "3"
            ]
          }
        }
      ]
    }
  }
}

 GET product/_search
{
  "query": {
    "bool": {
      "must": [
        {
          "match": {
            "skuTitle": "华为"
          }
        }
      ],
      "filter": [
        {
          "term": {
            "catalogId": "225"
          }
        },
        {
          "terms": {  
            "brandId": [
              "1", "2", "3"
            ]
          }
        }
      ]
    }
  }
}

GET product/_search
{
  "query": {
    "bool": {
      "must": [
        {
          "match": {
            "skuTitle": "华为"
          }
        }
      ],
      "filter": [
        {
          "term": {
            "catalogId": "225"
          }
        },
        {
          "terms": {  
            "brandId": [
              "1", "2", "3"
            ]
          }
        },
        {
          "terms": {  
            "attrValue": [
              "海思"
            ]
          }
        }
      ]
    }
  }
}

 GET product/_search
{
  "query": {
    "bool": {
      "must": [
        {
          "match": {
            "skuTitle": "华为"
          }
        }
      ],
      "filter": [
        {
          "term": {
            "catalogId": "225"
          }
        },
        {
          "terms": {  
            "brandId": [
              "1", "2", "3"
            ]
          }
        },
        {
          "terms": {  
            "attrValue": [
              "海思"
            ]
          }
        }
      ]
    }
  }
}

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值