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

宁波做网站价格全网整合营销推广

宁波做网站价格,全网整合营销推广,wordpress文章在那个文件夹,企业网站傻瓜搭建Elasticsearch实战#xff1a;常见错误及详细解决方案 1.read_only_allow_delete:“true” 当我们在向某个索引添加一条数据的时候#xff0c;可能#xff08;极少情况#xff09;会碰到下面的报错#xff1a; {error: {root_cause: [{常见错误及详细解决方案 1.read_only_allow_delete:“true” 当我们在向某个索引添加一条数据的时候可能极少情况会碰到下面的报错 {error: {root_cause: [{type: cluster_block_exception,reason: blocked by: [FORBIDDEN/12/index read-only / allow delete (api)];}],type: cluster_block_exception,reason: blocked by: [FORBIDDEN/12/index read-only / allow delete (api)];},status: 403 } 上述报错是说索引现在的状态是只读模式read-only如果查看该索引此时的状态 GET z1/_settings #结果如下 {z1 : {settings : {index : {number_of_shards : 5,blocks : {read_only_allow_delete : true},provided_name : z1,creation_date : 1556204559161,number_of_replicas : 1,uuid : 3PEevS9xSm-r3tw54p0o9w,version : {created : 6050499}}}} } 可以看到read_only_allow_delete : true说明此时无法插入数据当然我们也可以模拟出来这个错误 PUT z1 {mappings: {doc: {properties: {title: {type:text}}}},settings: {index.blocks.read_only_allow_delete: true} }PUT z1/doc/1 {title: es真难学 } 现在我们如果执行插入数据就会报开始的错误。那么怎么解决呢 清理磁盘使占用率低于 85%。手动调整该项具体参考官网 这里介绍一种我们将该字段重新设置为 PUT z1/_settings {index.blocks.read_only_allow_delete: null } 现在再查看该索引就正常了也可以正常的插入数据和查询了。 2. illegal_argument_exception 有时候在聚合中我们会发现如下报错 {error: {root_cause: [{type: illegal_argument_exception,reason: Fielddata is disabled on text fields by default. Set fielddatatrue on [age] in order to load fielddata in memory by uninverting the inverted index. Note that this can however use significant memory. Alternatively use a keyword field instead.}],type: search_phase_execution_exception,reason: all shards failed,phase: query,grouped: true,failed_shards: [{shard: 0,index: z2,node: NRwiP9PLRFCTJA7w3H9eqA,reason: {type: illegal_argument_exception,reason: Fielddata is disabled on text fields by default. Set fielddatatrue on [age] in order to load fielddata in memory by uninverting the inverted index. Note that this can however use significant memory. Alternatively use a keyword field instead.}}],caused_by: {type: illegal_argument_exception,reason: Fielddata is disabled on text fields by default. Set fielddatatrue on [age] in order to load fielddata in memory by uninverting the inverted index. Note that this can however use significant memory. Alternatively use a keyword field instead.,caused_by: {type: illegal_argument_exception,reason: Fielddata is disabled on text fields by default. Set fielddatatrue on [age] in order to load fielddata in memory by uninverting the inverted index. Note that this can however use significant memory. Alternatively use a keyword field instead.}}},status: 400 } 这是怎么回事呢是因为聚合查询时指定字段不能是text类型。比如下列示例 PUT z2/doc/1 {age:18 } PUT z2/doc/2 {age:20 }GET z2/doc/_search {query: {match_all: {}},aggs: {my_sum: {sum: {field: age}}} } 当我们向elasticsearch中添加一条数据时此时如果索引存在则直接新增或者更新文档不存在则先创建索引首先检查该age字段的映射类型。如上示例中我们添加第一篇文档时z1索引不存在elasticsearch会自动的创建索引然后为age字段创建映射关系es 就猜此时age字段的值是什么类型如果发现是text类型那么存储该字段的映射类型就是text此时age字段的值是text类型所以第二条插入数据age的值也是text类型而不是我们看到的long类型。我们可以查看一下该索引的mappings信息 GET z2/_mapping #mapping信息如下 {z2 : {mappings : {doc : {properties : {age : {type : text,fields : {keyword : {type : keyword,ignore_above : 256}}}}}}} } 上述返回结果发现age类型是text。而该类型又不支持聚合所以就会报错了。解决办法就是 如果选择动态创建一篇文档映射关系取决于你添加的第一条文档的各字段都对应什么类型。而不是我们看到的那样第一次是text第二次不加引号就是long类型了不是这样的。如果嫌弃上面的解决办法麻烦那就选择手动创建映射关系。首先指定好各字段对应什么类型。后续才不至于出错。 3.Result window is too large 很多时候我们在查询文档时一次查询结果很可能会有很多而 elasticsearch 一次返回多少条结果由size参数决定 GET e2/doc/_search {size: 100000,query: {match_all: {}} } 而默认是最多范围一万条那么当我们的请求超过一万条时比如有十万条就会报 Result window is too large, from size must be less than or equal to: [10000] but was [100000]. See the scroll api for a more efficient way to request large data sets. This limit can be set by changing the [index.max_result_window] index level setting. 意思是一次请求返回的结果太大可以另行参考 scroll API或者设置index.max_result_window参数手动调整size的最大默认值 #kibana中设置 PUT e2/_settings {index: {max_result_window: 100000} } #Python中设置 from elasticsearch import Elasticsearch es Elasticsearch() es.indices.put_settings(indexe2, body{index: {max_result_window: 100000}}) 如上例我们手动调整索引e2的size参数最大默认值到十万这时一次查询结果只要不超过 10 万就都会一次返回。 注意这个设置对于索引es的size参数是永久生效的。 4.持续更新中 更多优质内容请关注公号汀丶人工智能会提供一些相关的资源和优质文章免费获取阅读。
http://www.w-s-a.com/news/971528/

相关文章:

  • 重庆装修房子可以提取公积金吗长沙优化官网公司
  • 做外贸的网站都有哪些带后台的html网站源码
  • 厦门百度快速优化排名手机系统优化工具
  • 宁波网站制作公司推荐公司建站多少钱
  • 网络营销薪酬公司温州网站优化定制
  • 橙色在网站中的应用淘宝客绑定网站备案号
  • 杭州视频网站建设成都设计院排行
  • 慈溪建设网站盘丝洞app破解无限盘币
  • 关于服装店网站建设的策划方案seo关键词优化软件官网
  • 丰台高端网站建设土巴兔装修贵吗
  • 宽屏网站mysqli pdo wordpress
  • 2022年没封网站直接进入赣州网吧
  • 河南省建设厅证件证件查询网站硬件开发是什么意思
  • tp5做企业网站宿迁房产网租房信息
  • php高级网站开发wordpress不能添加文章
  • 小学校园网站建设付费阅读下载网站开发
  • 如何做招聘网站网站建设中 敬请期待
  • 雅安工程交易建设网站做vip电影网站
  • 网站建设方维网站标题title为什么不能频繁的改
  • 网站建设如何上传文件wordpress列表自定义数据表
  • 摄影课程自学网站科技项目的类型有
  • 未来最紧缺的十大专业长春seo顾问
  • 为什么点不开网站公关公司是做什么的
  • wordpress主要菜单如何对网站页面进行优化
  • 建设银行深分行圳招聘网站建立互联网公司网站
  • 湖南做旅游网站哪家最好html5手机网站免费模板
  • 云服务器上放多个网站wordpress ping大全
  • 以下属于网站的管理 更新 维护如何才能做好品牌网站建设
  • 国家工业和信息化部网站备案系统网站建设设计费用
  • 网站建设利弊宁波高端网站建设联系方式