带你读《Elastic Stack 实战手册》之18:——3.4.2.3.Search通过Kibana(7)

本文涉及的产品
Elasticsearch Serverless通用抵扣包,测试体验金 200元
简介: 带你读《Elastic Stack 实战手册》之18:——3.4.2.3.Search通过Kibana(7)

《Elastic Stack 实战手册》——三、产品能力——3.4.入门篇——3.4.2.Elasticsearch基础应用——3.4.2.3.Search通过Kibana(6) https://developer.aliyun.com/article/1231065


以上查询表示 brandName 包含“东” 和 “果” 至少匹配成功一次,查询结果如下:


"hits" : [
      {
        "_index" : "my_goods",
        "_type" : "_doc",
        "_id" : "4",
        "_score" : 1.5678144,
        "_source" : {
          "shopCode" : "sc00001",
          "brandName" : "山东苹果",
          "closeUserCode" : [
            "uc001",
            "uc002",
            "uc003"
          ],
          "skuCode_brandName" : "skuCode4山东苹果",
          "channelType" : "cloudPlatform",
          "publicPrice" : 16977.76,
          "goodsName_length" : 31,
          "groupPrice" : [
            {
              "level" : "level1",
              "boxLevelPrice" : "2488.88"
            },
            {
              "level" : "level2",
              "boxLevelPrice" : "3488.88"
            }
          ],
          "boxPrice" : [
            {
              "boxType" : "box1",
              "boxUserCode" : [
                "uc004",
                "uc005",
                "uc006",
                "uc001"
              ],
              "boxPriceDetail" : 4488.88
            },
            {
              "boxType" : "box2",
              "boxUserCode" : [
                "htd007",
                "htd008",
                "htd009",
                "uc0010"
              ],
              "boxPriceDetail" : 5488.88
            }
          ],
          "boostValue" : 1.2,
          "goodsName" : "山东苹果UA55RU7520JXXZ 苹果54英寸 5K超高清",
          "skuCode" : "skuCode4"
        }
      },
      {
        "_index" : "my_goods",
        "_type" : "_doc",
        "_id" : "2",
        "_score" : 0.2792403,
        "_source" : {
          "shopCode" : "sc00002",
          "brandName" : "苹果",
          "closeUserCode" : [
            "0"
          ],
          "skuCode_brandName" : "skuCode2苹果",
          "channelType" : "cloudPlatform",
          "publicPrice" : 12377.76,
          "goodsName_length" : 13,
          "groupPrice" : null,
          "boxPrice" : null,
          "boostValue" : 1.0,
          "goodsName" : "苹果 55英寸 3K超高清",
          "skuCode" : "skuCode2"
        }
      },
      {
        "_index" : "my_goods",
        "_type" : "_doc",
        "_id" : "1",
        "_score" : 0.2792403,
        "_source" : {
          "shopCode" : "sc00001",
          "brandName" : "苹果",
          "closeUserCode" : [
            "0"
          ],
          "skuCode_brandName" : "skuCode1苹果",
          "channelType" : "cloudPlatform",
          "publicPrice" : 32755.52,
          "goodsName_length" : 13,
          "groupPrice" : null,
          "boxPrice" : null,
          "boostValue" : 1.8,
          "goodsName" : "苹果 51英寸 4K超高清",
          "skuCode" : "skuCode1"
        }
      },
      {
        "_index" : "my_goods",
        "_type" : "_doc",
        "_id" : "3",
        "_score" : 0.21222264,
        "_source" : {
          "shopCode" : "sc00001",
          "brandName" : "美国苹果",
          "closeUserCode" : [
            "0"
          ],
          "skuCode_brandName" : "skuCode3美国苹果",
          "channelType" : "cloudPlatform",
          "publicPrice" : 16777.76,
          "goodsName_length" : 26,
          "groupPrice" : null,
          "boxPrice" : [
            {
              "boxType" : "box1",
              "boxUserCode" : [
                "htd003",
                "uc004"
              ],
              "boxPriceDetail" : 4388.88
            },
            {
              "boxType" : "box2",
              "boxUserCode" : [
                "uc005",
                "uc0010"
              ],
              "boxPriceDetail" : 5388.88
            }
          ],
          "boostValue" : 1.2,
          "goodsName" : "苹果UA55RU7520JXXZ 53英寸 4K高清",
          "skuCode" : "skuCode3"
        }
      },
  ...
]

当我们调整 minimum_should_match 为 2 时观察结果返回:


POST /my_goods/_search
{
  "query": {
    "bool": {
      "should": [
        {
          "term": {
            "brandName": {
              "value": "东"
    320         >   三、产品能力
            }
          }
        },
        {
          "term": {
            "brandName": {
              "value": "果"
            }
          }
        }
      ],
      "minimum_should_match" : 2
    }
  }
}
#返回:
"hits" : [
      {
        "_index" : "my_goods",
        "_type" : "_doc",
        "_id" : "4",
        "_score" : 1.5678144,
        "_source" : {
          "shopCode" : "sc00001",
          "brandName" : "山东苹果",
          "closeUserCode" : [
            "uc001",
            "uc002",
            "uc003"
          ],
          "skuCode_brandName" : "skuCode4山东苹果",
          "channelType" : "cloudPlatform",
          "publicPrice" : 16977.76,
          "goodsName_length" : 31,
          "groupPrice" : [
            {
              "level" : "level1",
              "boxLevelPrice" : "2488.88"
            },
            {
              "level" : "level2",
              "boxLevelPrice" : "3488.88"
            }
          ],
          "boxPrice" : [
            {
              "boxType" : "box1",
              "boxUserCode" : [
                "uc004",
                "uc005",
                "uc006",
                "uc001"
              ],
              "boxPriceDetail" : 4488.88
            },
            {
              "boxType" : "box2",
              "boxUserCode" : [
                "htd007",
                "htd008",
                "htd009",
                "uc0010"
              ],
              "boxPriceDetail" : 5488.88
            }
          ],
          "boostValue" : 1.2,
          "goodsName" : "山东苹果UA55RU7520JXXZ 苹果54英寸 5K超高清",
          "skuCode" : "skuCode4"
        }
      }
    ]


可以看到,只有 goodsName 出现 “东” 和 “果” 2 次以及 2 次以上的结果被查询到。

 《Elastic Stack 实战手册》——三、产品能力——3.4.入门篇——3.4.2.Elasticsearch基础应用——3.4.2.3.Search通过Kibana(8) https://developer.aliyun.com/article/1231063

相关实践学习
以电商场景为例搭建AI语义搜索应用
本实验旨在通过阿里云Elasticsearch结合阿里云搜索开发工作台AI模型服务,构建一个高效、精准的语义搜索系统,模拟电商场景,深入理解AI搜索技术原理并掌握其实现过程。
ElasticSearch 最新快速入门教程
本课程由千锋教育提供。全文搜索的需求非常大。而开源的解决办法Elasricsearch(Elastic)就是一个非常好的工具。目前是全文搜索引擎的首选。本系列教程由浅入深讲解了在CentOS7系统下如何搭建ElasticSearch,如何使用Kibana实现各种方式的搜索并详细分析了搜索的原理,最后讲解了在Java应用中如何集成ElasticSearch并实现搜索。  
相关文章
|
存储 中间件 开发工具
云计算的三个主要服务模型:IaaS、PaaS 和 SaaS
云计算的三个主要服务模型:IaaS、PaaS 和 SaaS
18236 0
|
机器学习/深度学习 并行计算 Shell
docker 获取Nvidia 镜像 | cuda |cudnn
本文分享如何使用docker获取Nvidia 镜像,包括cuda10、cuda11等不同版本,cudnn7、cudnn8等,快速搭建深度学习环境。
7009 0
|
存储 监控 测试技术
Kibana 的 Alert—Elastic Stack 实战手册
Kibana 的 Alert 模块主要用于 Elastic Stack 的监控告警。以一种相对较低的使用成本,将复杂的查询条件,编辑完成后监控不同的 Elastic Stack 的技术产品中产生的数据,最终把符合条件的告警信息以需要的方式反馈给用户。
5076 0
Kibana 的 Alert—Elastic Stack 实战手册
|
数据挖掘 大数据 关系型数据库
Doris和Greenplum数据库简单对比
【5月更文挑战第3天】Doris和Greenplum数据库简单对比
2018 0
|
存储 网络协议 数据中心
|
Kubernetes API Python
【K8S系列】深入解析Job(上))
【K8S系列】深入解析Job
859 0
|
2天前
|
存储 弹性计算 人工智能
【2025云栖精华内容】 打造持续领先,全球覆盖的澎湃算力底座——通用计算产品发布与行业实践专场回顾
2025年9月24日,阿里云弹性计算团队多位产品、技术专家及服务器团队技术专家共同在【2025云栖大会】现场带来了《通用计算产品发布与行业实践》的专场论坛,本论坛聚焦弹性计算多款通用算力产品发布。同时,ECS云服务器安全能力、资源售卖模式、计算AI助手等用户体验关键环节也宣布升级,让用云更简单、更智能。海尔三翼鸟云服务负责人刘建锋先生作为特邀嘉宾,莅临现场分享了关于阿里云ECS g9i推动AIoT平台的场景落地实践。
【2025云栖精华内容】 打造持续领先,全球覆盖的澎湃算力底座——通用计算产品发布与行业实践专场回顾
|
4天前
|
云安全 数据采集 人工智能
古茗联名引爆全网,阿里云三层防护助力对抗黑产
阿里云三层校验+风险识别,为古茗每一杯奶茶保驾护航!
古茗联名引爆全网,阿里云三层防护助力对抗黑产
|
4天前
|
存储 机器学习/深度学习 人工智能
大模型微调技术:LoRA原理与实践
本文深入解析大语言模型微调中的关键技术——低秩自适应(LoRA)。通过分析全参数微调的计算瓶颈,详细阐述LoRA的数学原理、实现机制和优势特点。文章包含完整的PyTorch实现代码、性能对比实验以及实际应用场景,为开发者提供高效微调大模型的实践指南。
534 2