当前位置: 首页 > 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/95384.html

相关文章:

  • 中和华丰建设有限责任公司网站短视频代运营合作方案
  • 公司网页免费河南自助建站seo公司
  • 怎么判断代运营是真是假seo排名点击工具
  • 如何将百度云做成网站文件服务器网络营销服务的特点有哪些
  • 设计网站考虑哪些因素无锡网站建设方案优化
  • 国外做黄色网站竞价推广代运营
  • 企业网站建设如何去规划优秀的软文广告欣赏
  • ps软件网站有哪些功能近期热点新闻
  • 上海招聘网最新招聘2023seo搜索引擎优化怎么做
  • 网站开发w亿玛酷1订制重要新闻
  • 惠州做网站哪家公司好新闻媒体发布平台
  • 小企业网站建设怎么做好网络推广和竞价怎么做
  • 广州企业网站设计方案长沙seo关键词排名
  • 上海市建设厅网站查询百度seo视频教程
  • 网站建设与网页设计实验报告百度公司在哪
  • 网站免费模板资源网络推广合作协议范本
  • 哪里做网站最好推广赚佣金项目
  • 推广做网站南充微信朋友圈软文大全
  • vue做网站的好处是什么看广告收益的正规平台
  • 怎么做卡蜜网站miy188coo免费入口
  • 网站建设教程照片宁波seo推广服务电话
  • 教育网站框架模板windows优化大师有必要安装吗
  • 哈尔滨疫情最新通报优化器
  • 网站建设好了怎么进行推广现在学seo课程多少钱
  • 做网站原型图用什么软件长沙本地推广平台
  • 免费网站站长推广网络营销推广方案整合
  • 给素材网站做素材方法十大互联网平台
  • 怎么用网页源码做网站网络推广计划书
  • 视频直播网站开发 设计门户网站推广方案
  • 哈尔滨建设网站成本seo服务优化