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

怎么看出网站有没有做404页面商城网站建设最新报价

怎么看出网站有没有做404页面,商城网站建设最新报价,外贸php网站源码,网站seo公司效果展示 在搜索框根据拼音首字母进行提示 拼音分词器 和IK中文分词器一样的用法#xff0c;按照下面的顺序执行。 # 进入容器内部 docker exec -it elasticsearch /bin/bash# 在线下载并安装 ./bin/elasticsearch-plugin install https://github.com/medcl/elasticsearch…效果展示 在搜索框根据拼音首字母进行提示 拼音分词器 和IK中文分词器一样的用法按照下面的顺序执行。  # 进入容器内部 docker exec -it elasticsearch /bin/bash# 在线下载并安装 ./bin/elasticsearch-plugin install https://github.com/medcl/elasticsearch-analysis-pinyin/releases/download/v7.12.1/elasticsearch-analysis-pinyin-7.12.1.zip#退出 exit #重启容器 docker restart elasticsearch 重启完成之后进行拼音分词可以看见每个字都有以及整个词语首字母组合成的一个。 ​ 自定义分词器 只用默认的功能还远远不够。 先用ik进行分词再用拼音分词器分 ​ ​ PUT /test {settings: {analysis: {analyzer: { my_analyzer: { tokenizer: ik_max_word,filter: py}},filter: {py: { type: pinyin,keep_full_pinyin: false,keep_joined_full_pinyin: true,keep_original: true,limit_first_letter_length: 16,remove_duplicated_term: true,none_chinese_pinyin_tokenize: false}}}},mappings: {properties: {name:{type: text,analyzer: my_analyzer}}} } 在test这份索引库当中再次测试就可以看见既有中文也有拼音分词了。 POST /test/_analyze {text:[北岭山脚鼠鼠],analyzer: my_analyzer } ​ 但是这里还会有问题用中文搜索时会把同音字也一起搜索到 ​ 指定搜索时和创建时用不同的分词器 ​ 在上面的语句里面加上了一条 search_analyzer: ik_smart POST /test/_doc/1 {id: 1,name: 狮子 } POST /test/_doc/2 {id: 2,name: 虱子 }GET /test/_search {query: {match: {name: 掉入狮子笼咋办}} } 结果如下 ​ DSL实现自动补全查询 ​ 查询补全语法 ​ 数据准备 // 自动补全的索引库 PUT test2 {mappings: {properties: {title:{type: completion}}} } // 示例数据 POST test2/_doc {title: [Sony, WH-1000XM3] } POST test2/_doc {title: [SK-II, PITERA] } POST test2/_doc {title: [Nintendo, switch] } 查询语句 // 自动补全查询 GET /test2/_search {suggest: {title_suggest: {text: s, // 关键字completion: {field: title, // 补全字段skip_duplicates: true, // 跳过重复的size: 10 // 获取前10条结果}}} } ​ ​ 酒店数据自动补全 ​ 修改酒店索引库数据结构 DELETE /hotel # 酒店数据索引库 PUT /hotel {settings: {analysis: {analyzer: {text_anlyzer: {tokenizer: ik_max_word,filter: py},completion_analyzer: {tokenizer: keyword,filter: py}},filter: {py: {type: pinyin,keep_full_pinyin: false,keep_joined_full_pinyin: true,keep_original: true,limit_first_letter_length: 16,remove_duplicated_term: true,none_chinese_pinyin_tokenize: false}}}},mappings: {properties: {id:{type: keyword},name:{type: text,analyzer: text_anlyzer,search_analyzer: ik_smart,copy_to: all},address:{type: keyword,index: false},price:{type: integer},score:{type: integer},brand:{type: keyword,copy_to: all},city:{type: keyword},starName:{type: keyword},business:{type: keyword,copy_to: all},location:{type: geo_point},pic:{type: keyword,index: false},all:{type: text,analyzer: text_anlyzer,search_analyzer: ik_smart},suggestion:{type: completion,analyzer: completion_analyzer}}} } 先删除再重新创建一个 然后在HotelDoc这个实体类里面新增一个字段suggestion,这个字段是由现有的字段组成放进去。 private ListString suggestion;this.suggestion Arrays.asList(this.brand,this.business);然后重新执行之前的批量插入的语句 ​ 再次测试搜索可以看见搜索得到的结果里面多出了品牌和商圈信息。  ​ 但是这里business字段有可能是由多个的要进行切割。 修改HotelDoc上面的构造方法的代码 if(this.business.contains(、)){//business有多个值需要切割String[] arr this.business.split(、);//添加元素this.suggestionnew ArrayList();this.suggestion.add(this.brand);Collections.addAll(this.suggestion,arr);}else {this.suggestion Arrays.asList(this.brand, this.business);} 再次插入数据可以看见多个词条已经分开了。  ​ 进行搜索测试 搜索所有以h开头的词条 ​ RestAPI实现自动补全 ​ 请求组装响应解析 Testvoid testSuggest() throws IOException {//1.准备requestSearchRequest request new SearchRequest(hotel);//2.准备DSlrequest.source().suggest(new SuggestBuilder().addSuggestion(suggestion,SuggestBuilders.completionSuggestion(suggestion).prefix(h).skipDuplicates(true).size(10)));//3.发起请求SearchResponse response client.search(request, RequestOptions.DEFAULT);//4.解析结果Suggest suggest response.getSuggest();//4.1根据补全查询名称获取补全结果CompletionSuggestion suggestions suggest.getSuggestion(suggestion);//4.2获取optionsListCompletionSuggestion.Entry.Option options suggestions.getOptions();//4.3遍历for (CompletionSuggestion.Entry.Option option : options) {String text option.getText().toString();System.out.println(text);}} 实现搜索框自动补全 Controller中 GetMapping(suggestion)public ListStringgetSuggestion(RequestParam(key)String prefix){return hotelService.getSuggestions(prefix);} Service中 Overridepublic ListString getSuggestions(String prefix) {try {//1.准备requestSearchRequest request new SearchRequest(hotel);//2.准备DSlrequest.source().suggest(new SuggestBuilder().addSuggestion(suggestion,SuggestBuilders.completionSuggestion(suggestion).prefix(prefix).skipDuplicates(true).size(10)));//3.发起请求SearchResponse response client.search(request, RequestOptions.DEFAULT);//4.解析结果Suggest suggest response.getSuggest();//4.1根据补全查询名称获取补全结果CompletionSuggestion suggestions suggest.getSuggestion(suggestion);//4.2获取optionsListCompletionSuggestion.Entry.Option options suggestions.getOptions();//4.3遍历ListStringlistnew ArrayList(options.size());for (CompletionSuggestion.Entry.Option option : options) {String text option.getText().toString();list.add(text);}return list;} catch (IOException e) {throw new RuntimeException(e);}} 效果演示 成功根据提示进行查询
http://www.hkea.cn/news/14464162/

相关文章:

  • 企业门户网站开发平台的设计廊坊seo关键词优化
  • 南京建设企业网站去视频网站做编辑
  • 商家入驻型网站建设深圳网站设计与制作公司
  • 湖州网站建设湖州怎么宣传自己的产品
  • 网站底部悬浮代码注册入口
  • 网站搭建网站南山网络科技有限公司
  • 东莞网站优化排名丝绸之路网站建设意义
  • 网站开发与设计课程时间国外企业招聘网站
  • 外贸生意做哪个网站好手机网站客户端
  • 平安车险官方保险网站网站自动识别手机
  • 怎么创建自己的网站平台app宁波微信小程序开发公司
  • 富通建设有限公司网站对海尔网站建设水平的评价
  • 营销型网站制作步骤五个学校网站建设工作方案
  • 做网站多少钱一般建设建行积分兑换商城网站
  • 成都网站维护多少钱安陆市网站
  • 怎样做公司的网站首页个人信用信息公示系统
  • 营销网站四大要素用jsp建设网站
  • 建设工程合同管理网站成都房地产信息网
  • 我做网站了电影网站 模板
  • 计算机网站开发项目上海房产做哪个网站好
  • c asp.net 做网站爱站关键词挖掘查询工具
  • 巢湖网站开发app推广代理去哪里找
  • 网站使用了seo优化工具怎么检测如何在网上卖货
  • 青岛做外贸网站的公司简介购物网站推广案例
  • 厦门网站建设小程序开发建设单位物业服务企业
  • 百度 网站 移动端嘉兴网站建设的地方
  • 上海免费网站建设服务wordpress cptui
  • 佛山网站建设网站建设山西建设集团网站
  • 网站流量统计分析的误区北京seo关键词排名
  • 教学网站系统流程图服务好的合肥网站建设