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

怎么查询网站是哪家公司做的深圳google推广

怎么查询网站是哪家公司做的,深圳google推广,营销管理网站,简历模版写在前面 通过completion suggester可以实现如下的效果: 其实就是做的like xxx%这种。通过FST这种数据结构来存储,实现快速的前缀匹配,并且可以将es所有的数据加载到内存中所以速度completion的查询速度非常快。 需要注意,如果…

写在前面

通过completion suggester可以实现如下的效果:
在这里插入图片描述
其实就是做的like xxx%这种。通过FST这种数据结构来存储,实现快速的前缀匹配,并且可以将es所有的数据加载到内存中所以速度completion的查询速度非常快。

需要注意,如果是某个字段想要使用completion suggester的功能,需要将其类型设置为completion,也就是我们需要显示的设置mapping来指定。

1:例子

首先来创建索引并指定mapping:

DELETE articlesPUT articles
{"mappings": {"properties": {"title": {"type": "text","fields": {"title_use_completion": {"type": "completion"}}}}}
}

接着插入数据:

POST articles/_bulk
{ "index": {} }
{ "title": "lucene is very cool" }
{ "index": {} }
{ "title": "Elasticsearch builds on top of lucene" }
{ "index": {} }
{ "title": "Elasticsearch rocks" }
{ "index": {} }
{ "title": "elastic is the company behind ELK stack" }
{ "index": {} }
{ "title": "Elk stack rocks" }

查询:

POST articles/_search 
{"size": 0,"suggest": {"article-suggester": {"prefix": "luc","completion": {"field": "title.title_use_completion"}}}
}

在这里插入图片描述
另外,es还支持一种基于上下文的suggestion,Context Suggerter,如下:
在这里插入图片描述
context分为两类,category和geo,如下:
在这里插入图片描述

以context为里来看下。

  • 首先来定义mapping
    在mapping中指定context的信息:
# 删除
DELETE comments
# 创建
PUT comments
# 指定mapping
PUT comments/_mapping
{"properties": {"comment_autocomplete": {"type": "completion","contexts": [{"type": "category","name": "comment_category"}]}}
}

数据:

# 录入数据并指定上下文是movies
POST comments/_doc
{"comment": "I love the star war movies","comment_autocomplete": {"input": ["start wars"],"contexts": {"comment_category": "movies"}}
}# 录入数据并指定上下文是coffee
POST comments/_doc
{"comment": "Where can I find a Starbucks","comment_autocomplete": {"input": ["starbucks"],"contexts": {"comment_category": "coffee"}}
}

movies上下文查询:

# 如果是movie上下文,返回start wars
POST comments/_search
{"suggest": {"MY_SUGGESTION": {"prefix": "sta","completion": {"field": "comment_autocomplete","contexts": {"comment_category": "movies"}}}}
}

在这里插入图片描述
coffee上下文查询:

# 如果是coffee上下文,返回starbucks
POST comments/_search
{"suggest": {"MY_SUGGESTION": {"prefix": "sta","completion": {"field": "comment_autocomplete","contexts": {"comment_category": "coffee"}}}}
}

在这里插入图片描述

最后看下term,phrase,completion三者的对比:
在这里插入图片描述

写在后面

参考文章列表

倒排索引:ES倒排索引底层原理及FST算法的实现过程 。

http://www.yidumall.com/news/65912.html

相关文章:

  • o2o网站开发价格中国疫情最新情况
  • 与网络公司洽谈做网站需要注意什么seo推广营销公司
  • 网站后台 黑链接抖音指数查询
  • 哪些网站的做的好看的图片google引擎免费入口
  • wordpress小黄锁优化搜索引擎
  • 武汉市东西湖城乡建设局网站seo企业优化方案
  • 东莞网站开发技术公司电话网络推广怎么收费
  • 大学做视频网站怎么样在百度上免费推广
  • 怎么做网站外链app如何推广
  • 给公司做网站百度seo快速提升排名
  • 流量劫持网站怎么做标题优化怎样选关键词
  • 济南平阴疫情西安网站建设方案优化
  • 静态网页怎么做网站360搜索指数
  • 方太网站谁做的网络营销案例分析题
  • 网站设计深圳联系电话?seo属于什么职业部门
  • 香港免费永久网站地址中国百强城市榜单
  • 长春品牌网站建设公司平台推广是做什么
  • 眉山做网站的公司微信seo什么意思
  • 网站建设多少钱裙爱站关键词查询
  • 网站做非经营性广告需备案阿里云免费域名
  • 企业网站怎么搭建优秀网站设计赏析
  • 2013网站建设方案陕西seo主管
  • 合肥网站seo优化排名公司昆明网站seo优化
  • 佛山网站建设公司排名榜网站seo诊断报告
  • 做网站的客户哪里找北京培训学校
  • 中小型网站建设资讯广州seo排名优化
  • 设计某网站的登录和注册程序搜索引擎优化代理
  • 17网站一起做网店可靠吗网店运营
  • asp技术做网站推广竞价的公司有哪些
  • 网站开发与管理实训项目网站推广入口