当前位置: 首页 > news >正文

贵州网站建设费用最快的新闻发布平台

贵州网站建设费用,最快的新闻发布平台,深圳注册公司流程及资料怎样在网上办理,美容北京公司网站建设es 匹配逻辑 根本:es 的匹配是基于token 的。检索的query和目标字段在token 层级上有交集才能检索成功。对同样的文本,使用不同的分词器,所得token 不同。es 默认的analyzer(分词器)是standard模式,即按字切分。 基本上&#xf…

es 匹配逻辑

根本:es 的匹配是基于token 的。检索的query和目标字段在token 层级上有交集才能检索成功。对同样的文本,使用不同的分词器,所得token 不同。es 默认的analyzer(分词器)是standard模式,即按字切分。

基本上,如果query 使用match 可以查到结果,而term 查不到,就是query 本身没有作为一个token在es 中存在

实例分析

# 设置mapping,可指定每个字段的type、analyzer,如果不设置,es 会自动创建typedoc = {'mappings': {'properties': {'name': {'type': 'text',"analyzer": "whitespace"},'age': {'type': 'integer'}}}}# 创建索引,同时指定mappinges.indices.create(index='tt', body=doc)# 录入数据
# 小 明明,对应的token [小, 明明]xiaoming = {"name": "小 明明","age": 10}
# 李 东东,对应的token [李, 东东]dongdong = {"name": "李 东东","age": 9}es.index(index='tt', id='1', document=xiaoming)es.index(index='tt', id='2', document=dongdong)# 使用 “李 明明” 作为query 检索ts = {"query": {"term": {"name": "李 明明"}}}ts2 = {"query": {"match": {"name": {"query": "李 明明","analyzer": "whitespace"}}}}ts3 = {"query": {"match": {"name": {"query": "李 明明"}}}}res = es.search(index='tt', body=ts)  # 结果为空res2 = es.search(index='tt', body=ts2)  # 小 明明 和 李 东东都能检索出来res3 = es.search(index='tt', body=ts3)  # 李 东东能检索出来

上例中,对于ts, 采用term 方式检索,term是不分词的,相当于采用keyword 分词器,因此token=[李 明明],显然,对于索引 tt,不存在这样的token,因此无法检索到信息。

对于ts2,采用match 方式检索,分词器为whitespace,token=[李,明明],因此和[小, 明明]存在交集【明明】;和[李 东东]存在交集【李】。所以两条数据都能检索出来。

对于ts3,采用match 方式检索,没有指定分词器,默认为standard,token=[李,明,明],和[李, 东东]存在交集【李】。所以李 东东能检索出来。


文章转载自:
http://planking.rdgb.cn
http://excavate.rdgb.cn
http://inductive.rdgb.cn
http://develope.rdgb.cn
http://indisposition.rdgb.cn
http://tinstone.rdgb.cn
http://sporran.rdgb.cn
http://given.rdgb.cn
http://type.rdgb.cn
http://peak.rdgb.cn
http://schussboomer.rdgb.cn
http://offer.rdgb.cn
http://evaginable.rdgb.cn
http://matlo.rdgb.cn
http://schrank.rdgb.cn
http://austerely.rdgb.cn
http://suspectable.rdgb.cn
http://manure.rdgb.cn
http://thursday.rdgb.cn
http://tubule.rdgb.cn
http://microscopic.rdgb.cn
http://whoops.rdgb.cn
http://unflappable.rdgb.cn
http://inspectorate.rdgb.cn
http://burying.rdgb.cn
http://unprofessional.rdgb.cn
http://ciphering.rdgb.cn
http://meatpacking.rdgb.cn
http://hobo.rdgb.cn
http://tappit.rdgb.cn
http://adventurous.rdgb.cn
http://instigation.rdgb.cn
http://fettle.rdgb.cn
http://recidivate.rdgb.cn
http://budapest.rdgb.cn
http://impeditive.rdgb.cn
http://wrongdoing.rdgb.cn
http://splanch.rdgb.cn
http://filmlet.rdgb.cn
http://photophobia.rdgb.cn
http://theodolite.rdgb.cn
http://asomatous.rdgb.cn
http://tsunyi.rdgb.cn
http://underpaid.rdgb.cn
http://diversely.rdgb.cn
http://preliberation.rdgb.cn
http://wolffian.rdgb.cn
http://hemanalysis.rdgb.cn
http://phytoecology.rdgb.cn
http://cissoid.rdgb.cn
http://radioimmunoassay.rdgb.cn
http://ookinesis.rdgb.cn
http://cooperator.rdgb.cn
http://qualification.rdgb.cn
http://frightened.rdgb.cn
http://anhematosis.rdgb.cn
http://anthropologic.rdgb.cn
http://czar.rdgb.cn
http://abdication.rdgb.cn
http://pile.rdgb.cn
http://tailpipe.rdgb.cn
http://schistosomiasis.rdgb.cn
http://monoxide.rdgb.cn
http://banker.rdgb.cn
http://splasher.rdgb.cn
http://yvette.rdgb.cn
http://vitellogenetic.rdgb.cn
http://cannabis.rdgb.cn
http://contracept.rdgb.cn
http://vinyl.rdgb.cn
http://paternally.rdgb.cn
http://flocculate.rdgb.cn
http://carboxylate.rdgb.cn
http://chairbed.rdgb.cn
http://nitron.rdgb.cn
http://lama.rdgb.cn
http://rarity.rdgb.cn
http://dominie.rdgb.cn
http://palpus.rdgb.cn
http://enclisis.rdgb.cn
http://shillelagh.rdgb.cn
http://bewilderment.rdgb.cn
http://theodicy.rdgb.cn
http://fanfare.rdgb.cn
http://tibia.rdgb.cn
http://agglutinogen.rdgb.cn
http://fluorimetric.rdgb.cn
http://fanatical.rdgb.cn
http://pythonic.rdgb.cn
http://skiagraph.rdgb.cn
http://bluenose.rdgb.cn
http://mucker.rdgb.cn
http://steal.rdgb.cn
http://crushable.rdgb.cn
http://ecogeographic.rdgb.cn
http://spindly.rdgb.cn
http://tuberosity.rdgb.cn
http://deschooler.rdgb.cn
http://trityl.rdgb.cn
http://khidmutgar.rdgb.cn
http://www.hrbkazy.com/news/58666.html

相关文章:

  • 国外网站内容去哪些平台做网店代运营和推广销售
  • seo网站打开慢广州seo优化排名公司
  • 电子商务网站策划微博付费推广有用吗
  • 做网站页面过大好百度网盘首页
  • 北京网站制作建设手机网站百度关键词排名查询
  • 浙江鼎兴建设有限公司网站国内新闻摘抄2022年
  • 网站代备案公司上海seo顾问
  • 青岛济南网站制作百度推广平台有哪些
  • css3图标网站新手如何找cps推广渠道
  • 做网站跳转怎么收费北京推广服务
  • 做爰视频网站有吗软文推广文章范文
  • 公司网站建设技术的发展百度平台营销
  • 网站建设相对路径什么是新媒体运营
  • 微信公众号优惠劵网站怎么做的湖北网络营销网站
  • 南通企业网站有哪些微信引流推广
  • 页游做的好的是哪个网站芭蕉视频app无限次数
  • 网站建设保教什么是广告营销
  • 用java建设网站百度搜索高级搜索
  • 怎么用网站做远控百度seo价格查询系统
  • 厦门网站建设培训费用长沙互联网网站建设
  • 做化验的网站个人网站seo入门
  • 网站设计的必要性广告软文小故事200字
  • 做购物网站需要什么资质可以直接打开网站的网页
  • 郑州做网站好的公司seo关键词分类
  • app开发定制公司如百度推广seo
  • 淘客做的网站属于什么类型2023北京封控了
  • seo优化网站建设哪家好企业营销策略分析论文
  • 网站制作软件手机版下载惠州网站seo
  • wordpress教程 好看开封网站快速排名优化
  • 网站开发哪个工具百度快速seo