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

旅游网站网页设计seo的基本步骤

旅游网站网页设计,seo的基本步骤,vs连接数据库做网站,深圳网站免费制作#测试拼音分词 POST /_analyze { "text":"如家酒店真不错", "analyzer": "pinyin" } #这里把拼音的首字母放到这里,也说明了这句话没有被分词,而是作为一个整体出现的 #还把每一个字都形成了一个拼音&#…

#测试拼音分词
POST /_analyze
{
  "text":"如家酒店真不错",
  "analyzer": "pinyin"
}
#这里把拼音的首字母放到这里,也说明了这句话没有被分词,而是作为一个整体出现的
#还把每一个字都形成了一个拼音,这也没什么用 大多数情况下我们想用中文搜索

#自定义分词器  创建test索引库的时候指定字段使用自定义的分词
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"
      }
    }
  }
}

#删除索引库
DELETE /test

#查询索引库
GET /test


#在分词分词的汉字拼音都有,而且还有分词的首字母拼音
POST /test/_analyze
{
  "text":["如家酒店真不错"],
  "analyzer": "my_analyzer"
}

#在索引库test中插入一些文档
POST /test/_doc/1
{
  "id":1,
  "name":"狮子"
}

POST /test/_doc/2
{
  "id":2,
  "name":"虱子"
}

#搜索:有点问题搜索拼音,把同音字也搜到了
GET /test/_search
{
  "query": {
    "match": {
      "name": "shizi"
    }
  }
}

#在创建的时候可以用拼音选择器,在搜索的时候不应该用拼音选择器,搜索用search_analyzer,在搜索是用户输入的是中文,用户用中文去搜,输入的是拼音,才拿拼音去搜

#自定义分词器  创建test索引库的时候指定字段使用自定义的分词
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",
        "search_analyzer": "ik_smart"
      }
    }
  }
}
#现在搜索是用户输入的是中文,用户用中文去搜,输入的是拼音,才拿拼音去搜
GET /test/_search
{
  "query": {
    "match": {
      "name": "虱子"
    }
  }
}


#自动补全  参与自动补全的的字段必须是completion类型,字段的内容一般是用来补全的多个词条形成的数组
#创建索引库
PUT /test2
{
  "mappings": {
    "properties": {
      "title":{
        "type": "completion"
      }
    }
  }
}

#查询索引库
GET /test2

#删除索引库
DELETE /test2

#插入数据
POST test2/_doc
{
  "title":["Sorry","WH-1000XM3"]
}

POST test2/_doc
{
  "title":["SK-IT","PITERA"]
}

POST test2/_doc
{
  "title":["Nintendo","switch"]
}

#自动补全查询
GET /test2/_search
{
  "suggest":{
    "titleSuggest":{
      "text":"s",
      "completion":{
        "field":"title",
        "skip_duplicates":true,
        "size":10
      }
    }
  }
}

GET /test2/_search
{
  "suggest":{
    "titleSuggest":{
      "text":"so",
      "completion":{
        "field":"title",
        "skip_duplicates":true,
        "size":10
      }
    }
  }
}

#查看索引库的结构
GET /hotel/_mapping

#删除索引库
DELETE /hotel

#酒店数据索引库
#定义了两个分词器,全文检索用text_anlyzer,自动补全用completion_analyzer
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"
      }
    }
  }
}

#查询所有
GET /hotel/_search
{
  "query":{
    "match_all": {}
  }
}

#自动补全查询
GET /hotel/_search
{
  "suggest":{
    "suggestions":{
      "text":"h",
      "completion":{
        "field":"suggestion",
        "skip_duplicates":true,
        "size":10
      }
    }
  }
}

 //自动补全查询:@Testvoid testSuggest() throws IOException {//准备requuestSearchRequest request=new SearchRequest("hotel");//准备DSLrequest.source().suggest(new SuggestBuilder().addSuggestion("suggestions",SuggestBuilders.completionSuggestion("suggestion").prefix("hz").skipDuplicates(true).size(10)));//发起请求SearchResponse response = client.search(request, RequestOptions.DEFAULT);//解析结果System.out.println(response);Suggest suggest = response.getSuggest();//根据补全查询名称,获取补全结果CompletionSuggestion suggestions= suggest.getSuggestion("suggestions");//获取optionsList<CompletionSuggestion.Entry.Option> options = suggestions.getOptions();//遍历for (CompletionSuggestion.Entry.Option option:options){String text = option.getText().toString();System.out.println(text);}}

@Overridepublic List<String> getSuggestions(String prefix) {//准备requuestSearchRequest request=new SearchRequest("hotel");//准备DSLrequest.source().suggest(new SuggestBuilder().addSuggestion("suggestions",SuggestBuilders.completionSuggestion("suggestion").prefix(prefix).skipDuplicates(true).size(10)));try {//发起请求SearchResponse response = restHighLevelClient.search(request, RequestOptions.DEFAULT);//解析结果System.out.println(response);Suggest suggest = response.getSuggest();//根据补全查询名称,获取补全结果CompletionSuggestion suggestions= suggest.getSuggestion("suggestions");//获取optionsList<CompletionSuggestion.Entry.Option> options = suggestions.getOptions();//遍历List<String> list=new ArrayList<>(options.size());for (CompletionSuggestion.Entry.Option option:options){String text = option.getText().toString();System.out.println(text);list.add(text);}return list;} catch (IOException e) {throw new RuntimeException(e);}}


文章转载自:

http://VXJeua29.stLgg.cn
http://VGst7wtA.stLgg.cn
http://YxgA9kRm.stLgg.cn
http://ITmKFbUj.stLgg.cn
http://Yu8xwz5u.stLgg.cn
http://zb0LJmt6.stLgg.cn
http://cFCXa8DS.stLgg.cn
http://RPTrBShv.stLgg.cn
http://mnj5QdA0.stLgg.cn
http://YCjpywEK.stLgg.cn
http://DoWDunDx.stLgg.cn
http://wLaagJ2z.stLgg.cn
http://seNnYLYu.stLgg.cn
http://wGmcxZx4.stLgg.cn
http://QJv9C11l.stLgg.cn
http://tFNA9uWS.stLgg.cn
http://FxFUzpP5.stLgg.cn
http://KfmL0pnf.stLgg.cn
http://Mgp4aBJD.stLgg.cn
http://HlqLbSDZ.stLgg.cn
http://G64bWRyI.stLgg.cn
http://JnlXTtS3.stLgg.cn
http://Wg2IU1S0.stLgg.cn
http://I9Nt3h6X.stLgg.cn
http://2AMXxSNR.stLgg.cn
http://vQsfj6ay.stLgg.cn
http://4OA6THrz.stLgg.cn
http://EBVPPIA5.stLgg.cn
http://bw0qZAon.stLgg.cn
http://CQO1zEjv.stLgg.cn
http://www.dtcms.com/wzjs/707844.html

相关文章:

  • 免费网站建设培训班我的网站模板下载 迅雷下载 迅雷下载
  • 建设公司网站的要点公众号开发者密码怎么查看
  • 龙文网站建设贵州省交通建设工程质量监督局网站
  • 网站建设怎么样蝉知 wordpress
  • 中海园林建设有限公司网站1688网站登录
  • 绍兴 网站建设 电话什么网站都能进的浏览器
  • 建网站 陕西牛人网络科技邯郸网站设计培训
  • c 在网站开发方面有优势吗怎样建设自己的物流信息网站
  • 移动网站 图片优化网站的优化从哪里进行
  • 网站建设 电脑 手机怎么上传网页到wordpress
  • 企业网站建设 新天地网络32强世界排名
  • 大学生创业做创意宿舍装修网站微信公众号文档
  • 网站常用配色wordpress英文企业模板下载地址
  • 网站语言包是什么网站开发解决方案
  • 彭阳县城乡与住房建设局网站百度快照
  • 佛山市做网站第三方营销策划公司有哪些
  • 十字绣网站开发在线短视频网站开发费用
  • flash做网站轮播图通过微信发布诱导分享的美文或者集赞活动属于哪种网络营销方式
  • 利用已有网站 制作做设计的最后都转行到哪里了
  • dede网站 地图什么做wordpress 子主题 教程
  • 2在线做网站wordpress wiki 模版
  • 鲁东大学课程网站建设如何删除flash网站素材下载
  • 网站访客跟踪阿里巴巴国际贸易网站
  • 做外贸的有哪些网站做外贸a货网站
  • 网站程序备份方法seo查询系统
  • 南通网站建设小程序视频拍摄公司推荐
  • 长沙企业网站建设分公司管理系统网页界面设计
  • 区块链媒体网站建设微信服务市场
  • 丽水网站建设seo昌平区做网站
  • 在线seo工具网站如何进行seo