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

深圳网站建设及推广湖南省政务服务网 网站建设要求

深圳网站建设及推广,湖南省政务服务网 网站建设要求,珠海百度快速优化,万能推广app1. 使用场景 一般在以下几种情况时#xff0c;我们需要重建索引#xff1a; 索引的 Mappings 发生变更#xff1a;字段类型更改#xff0c;分词器及字典更新 索引的 Setting 发生变更#xff1a;索引的主分片数发生改变 集群内#xff0c;集群间需要做数据迁移 Elastiic…1. 使用场景 一般在以下几种情况时我们需要重建索引 索引的 Mappings 发生变更字段类型更改分词器及字典更新 索引的 Setting 发生变更索引的主分片数发生改变 集群内集群间需要做数据迁移 ElastiicSearch 的内置提供的 API Update By Query : 在现有索引上重建 Reindex在其他索引上重建索引 2. Update By Query 2.1 案例一 为索引增加子字段 改变 Mapping 增加子字段使用英文分词器 此时尝试对子字段进行查询 虽然有数据已经存在但是没有返回结果 执行 Update By Query 尝试对 Multi-Fields 查询查询 返回结果 # 写入文档 PUT blogs/_doc/1 {   content:Hadoop is cool,   keyword:hadoop } # 修改 Mapping增加子字段使用英文分词器 PUT blogs/_mapping {   properties : {     content : {       type : text,       fields : {         english : {           type : text,           analyzer:english         }       }     }   } } # 写入文档 PUT blogs/_doc/2 {   content:Elasticsearch rocks,   keyword:elasticsearch } # 查询新写入文档 POST blogs/_search {   query: {     match: {       content.english: Elasticsearch     }   } } # 查询 Mapping 变更前写入的文档 POST blogs/_search {   query: {     match: {       content.english: hadoop     }   } } # Update所有文档 POST blogs/_update_by_query { } 2.2 案例二更改已有字段类型的 Mappings ES 不允许在原有 Mapping 上对字段类型进行修改 只能创建新的索引并设定正确的字段类型在重新导入数据 # 查询 GET blogs/_mapping PUT blogs/_mapping {         properties : {         content : {           type : text,           fields : {             english : {               type : text,               analyzer : english             }           }         },         keyword : {           type : keyword         }       } } 返回输出 {   error: {     root_cause: [       {         type: illegal_argument_exception,         reason: mapper [keyword] of different type, current_type [text], merged_type [keyword]       }     ],     type: illegal_argument_exception,     reason: mapper [keyword] of different type, current_type [text], merged_type [keyword]   },   status: 400 } # 创建新的索引并且设定新的Mapping PUT blogs_fix/ {   mappings: {     properties: {       content: {         type: text,         fields: {           english: {             type: text,             analyzer: english           }         }       },       keyword: {         type: keyword       }     }   } } # Reindx API POST  _reindex {   source: {     index: blogs   },   dest: {     index: blogs_fix   } } 返回输出 {   took : 17,   timed_out : false,   total : 2,   updated : 0,   created : 2,   deleted : 0,   batches : 1,   version_conflicts : 0,   noops : 0,   retries : {     bulk : 0,     search : 0   },   throttled_millis : 0,   requests_per_second : -1.0,   throttled_until_millis : 0,   failures : [ ] } GET  blogs_fix/_doc/1 返回输出 {   _index : blogs_fix,   _type : _doc,   _id : 1,   _version : 1,   _seq_no : 0,   _primary_term : 1,   found : true,   _source : {     content : Hadoop is cool,     keyword : hadoop   } } # 测试 Term Aggregation POST blogs_fix/_search {   size: 0,   aggs: {     blog_keyword: {       terms: {         field: keyword,         size: 10       }     }   } } 返回输出 {   took : 4,   timed_out : false,   _shards : {     total : 1,     successful : 1,     skipped : 0,     failed : 0   },   hits : {     total : {       value : 2,       relation : eq     },     max_score : null,     hits : [ ]   },   aggregations : {     blog_keyword : {       doc_count_error_upper_bound : 0,       sum_other_doc_count : 0,       buckets : [         {           key : elasticsearch,           doc_count : 1         },         {           key : hadoop,           doc_count : 1         }       ]     }   } } ———————————————— 版权声明本文为博主原创文章遵循 CC 4.0 BY-SA 版权协议转载请附上原文出处链接和本声明。                          原文链接https://blog.csdn.net/xixihahalelehehe/article/details/114521624
http://www.zqtcl.cn/news/211475/

相关文章:

  • 个人可做网站需要什么材料可以做3d电影网站
  • 温州网站建设专家网站推广软件推广
  • 24淘宝网站建设编程做网站
  • 公司网站模板怎么做自适应网站设计尺寸
  • 滨州正规网站建设价格简单网站制作
  • 创建网站平台电商系统源码
  • 滕州本地网站建设网站维护中模版
  • 商城类网站设计制作开发公司 张庆
  • seo擦边球网站宝安网站制作
  • 文山北京网站建设wordpress漂亮破解主题
  • 做网站需要什么证明嘛wordpress和自己写
  • 蚌埠市网站建设公司网站建设 技术 哪些
  • 网站收录查询临沂seovisual c 网站开发
  • 国际空间站vs中国空间站做网站在哪里接活
  • 怎样宣传网站营销外包公司
  • 工程网站模板制作教程具有价值的专业网站建设平台
  • 用wex5可以做网站吗邯郸seo快速排名
  • 高端品牌网站建设兴田德润可信赖网络运营方案怎么写
  • 新公司网站建设合肥关键词排名优化
  • 网站排名优化+o+m西安网络推广平台公司
  • 找网站建设公司需要注意什么常州网站建设公司好么
  • 不备案的网站很慢网站双线主机优势
  • 南京电子商务网站建设23个营销专业术语
  • 建设银行官网官方网站学习网页制作的网站
  • 开发网站需要什么硬件今年最流行的装修风格
  • 门户网站建设中标结果百度资讯指数
  • 定制企业网站开发公司网站建设的6个基本步骤
  • 网站建设与维护案列网站作品怎么做
  • 茂名放心营销网站开发seo收费
  • 旅游网站品牌建设本地使用宝塔安装wordpress