Elasticsearch常见问题解决办法

扩展新字段,处理历史数据

设置默认值 、批量更新、通过datax同步

 

扩展新字段,_source元数据历史数据未索引问题

需要重新写入数据,增改后会重新索引新字段

 

关于时间差8小时

ES默认使用UTC时间,存储时转为UTC

  • 写入带时区 如:2020-04-01T08:00:00+08:00
  • 写入使用时间戳
  • 查询指定字段的时区


索引数据迁移_reindex、请求超时

ERROR The requested URL could not be retrieved

后台未停止 ,还在运行

 

空查询处理方式

null 查询 、使用missing查询

 

忽略大小写模糊搜索实现

Mapping设置

{

    "settings": {

        "analysis": {

            "analyzer": {

                "caseSensitive": {

                    "filter": "lowercase",

                    "type": "custom",

                    "tokenizer": "keyword"

                }

            }

        }

    },

    "mappings": {

        "personInfo": {

            "properties": {

                "userName": {

                    "type": "string",

                    "analyzer": "caseSensitive",

                    "search_analyzer": "caseSensitive"

                }

            }

        }

    }

}

 

 

 

posted @ 2020-04-01 21:53  BensonWei  阅读(973)  评论(0编辑  收藏  举报