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

马关网站建设天津做优化好的公司

马关网站建设,天津做优化好的公司,复制链接提取视频软件下载,邢台网上办事大厅Elasticsearch 自带一种自动补全类型 completion 这种类型不在mapping文档里面有点坑。 先直接上例子。 建立 index,把我们要自动补全的字段设置为 completion 类型 或者直接设置为子类型 PUT /blogs_completion/ {"mappings": {"tech": {"properties…

Elasticsearch 自带一种自动补全类型 completion 这种类型不在mapping文档里面有点坑。

先直接上例子。

建立 index,把我们要自动补全的字段设置为 completion 类型
或者直接设置为子类型

PUT /blogs_completion/
{"mappings": {"tech": {"properties": {"body": {"type": "completion"}}}}
}// 设置为子类型
PUT /blogs_completion/
{"mappings": {"properties": {"body": {"type": "text","fields": {"suggest":{"type":"completion"},"keyword":{"type":"keyword"}}}}}
}//填充测试用例inter开头文本,和inter 的变形单词inber等
POST _bulk/?refresh=true
{ "index" : { "_index" : "blogs_completion", "_type" : "tech" } }
{ "body": "interface test1"}
{ "index" : { "_index" : "blogs_completion", "_type" : "tech" } }
{ "body": "interf test2"}
{ "index" : { "_index" : "blogs_completion", "_type" : "tech" } }
{ "body": "inter test3"}
{ "index" : { "_index" : "blogs_completion", "_type" : "tech" } }
{ "body": "inber test"}
{ "index" : { "_index" : "blogs_completion", "_type" : "tech" } }
{ "body": "sinter test"}// 使用带模糊匹配的 completion suggester 查询POST blogs_completion/_search?pretty
{ "size": 0,"suggest": {"blog-suggest": {"prefix": "inter","completion": {"size":"5","field": "body","fuzzy" : {"fuzziness" : 2}}}}
}// 结果{"took" : 1,"timed_out" : false,"_shards" : {"total" : 5,"successful" : 5,"skipped" : 0,"failed" : 0},"hits" : {"total" : 0,"max_score" : 0.0,"hits" : [ ]},"suggest" : {"blog-suggest" : [{"text" : "inter","offset" : 0,"length" : 5,"options" : [{"text" : "inter test","_index" : "blogs_completion","_type" : "tech","_id" : "Fd_wOHABW8nrxgV2Ej6u","_score" : 3.0,"_source" : {"body" : "inter test"}},{"text" : "interf test","_index" : "blogs_completion","_type" : "tech","_id" : "FN_wOHABW8nrxgV2Ej6u","_score" : 3.0,"_source" : {"body" : "interf test"}},{"text" : "interface test","_index" : "blogs_completion","_type" : "tech","_id" : "E9_wOHABW8nrxgV2Ej6u","_score" : 3.0,"_source" : {"body" : "interface test"}},{"text" : "inber test","_index" : "blogs_completion","_type" : "tech","_id" : "HN__OHABW8nrxgV2lD4C","_score" : 2.0,"_source" : {"body" : "inber test"}}]}]}
}

概述:

Elasticsearch 自带 suggest query 的功能,作为自动补全和查询建议的工具,称为 suggester

分为四种:

  1. Term suggester
  2. Phrase Suggester
  3. Completion Suggester
  4. Context Suggester

Completion Suggester 已经可以满足我们一般的带模糊查询的前缀自动补全功能,
如果要做更复杂的自动补全,可以结合 term suggester 和 phrase suggester 和 completion,同时查询,合并结果,得到更复杂的结果

一般详细文档:

https://blog.csdn.net/wwd0501/article/details/80595201

官方详情查考

https://www.elastic.co/guide/en/elasticsearch/reference/current/search-suggesters.html#context-suggester

http://www.mmbaike.com/news/38392.html

相关文章:

  • 视觉传达设计好找工作吗seo推广有哪些方式
  • 天津建设网站首页免费seo工具大全
  • 制作一个.net网站需要网站优化seo培
  • 购物网站运营seo排名优化首页
  • 新疆建设厅官方网站文件webview播放视频
  • 网站建设行业前景百度关键词搜索怎么收费
  • 厦门网站建设的公司哪家好惠州抖音seo
  • 邯郸教育网站建设如何做网络宣传推广
  • wordpress导航网站模板下载精准营销的案例
  • 卫生间装修效果图扬州seo博客
  • wordpress添加logo百度seo多少钱一个月
  • 网站备案提交信息吗适合口碑营销的产品
  • 微博如何做的跟网站一样中国广告公司前十强
  • 温州高端网站建设seo推广经验
  • 网站域名有哪些网络营销策划书结构
  • 网站建设公司做ppt吗免费涨热度软件
  • dede网站优化如何提高自己在百度的排名
  • 适合公司建设的网站公司做网络推广怎么做
  • 网站是用什么软件做的吗seo整体优化步骤怎么写
  • 设计网站什么叫空间不稳定关键词优化排名用哪些软件比较好
  • 大连网站建设腾讯大厦拼多多代运营公司十大排名
  • 美女做爰网站国产承接网络推广外包业务
  • 网站建设测试验收报告北京正规seo搜索引擎优化价格
  • 公司网站公司正规电商平台有哪些
  • 新手做网站需要哪些教材百度下载免费安装最新版
  • 商机互联做网站怎么样网页优化怎么做
  • 南阳网站建设页面seo推广营销靠谱
  • 怎么样才能做好营销热门seo推广排名稳定
  • 做外贸企业网站百度热门关键词排名
  • 主题资源网站建设上海搜索seo