水利普查档案数字化全流程指南:合规归档+效率提升实操方案
不少水利系统的朋友最近都在问,存量水利普查档案转数字化怎么才能符合归档要求,还能少踩坑?毕竟很多单位攒了十几年的普查档案,既有纸质的河湖勘测表、工程台账,也有老的光盘存储数据,整理起来头都大。这篇我就...
2026年08月22日 08:50:06
所有依赖均提供精准下载地址,无需自行查找:
IK分词器版本必须和ES版本完全一致,否则会导致ES启动失败;ES禁止用root账户启动,需提前新建普通用户并给ES目录授权。
解压ES安装包后,修改config/elasticsearch.yml文件,完整可复制配置如下:
```yaml cluster.name: archive-es node.name: archive-es-node-1 network.host: 0.0.0.0 http.port: 9200 discovery.type: single-node xpack.security.enabled: false http.cors.enabled: true http.cors.allow-origin: "" ```将IK分词器压缩包解压到ES的plugins目录下,新建ik文件夹存放所有解压后的文件,重启ES服务,执行curl http://localhost:9200/_cat/plugins,返回ik即配置成功。
用Postman或Kibana向ES发送PUT请求创建档案专属索引,完整请求如下:
```json PUT /archive_index { "settings": { "number_of_shards": 3, "number_of_replicas": 1, "analysis": { "analyzer": { "ik_smart_analyzer": { "tokenizer": "ik_smart" }, "ik_max_word_analyzer": { "tokenizer": "ik_max_word" } } } }, "mappings": { "properties": { "id": {"type": "long"}, "archive_code": {"type": "keyword"}, "title": {"type": "text", "analyzer": "ik_max_word_analyzer", "search_analyzer": "ik_smart_analyzer"}, "author": {"type": "text", "analyzer": "ik_smart_analyzer"}, "create_date": {"type": "date", "format": "yyyy-MM-dd HH:mm:ss||yyyy-MM-dd"}, "retention_period": {"type": "keyword"}, "fonds_code": {"type": "keyword"}, "catalog_code": {"type": "keyword"}, "full_content": {"type": "text", "analyzer": "ik_max_word_analyzer", "search_analyzer": "ik_smart_analyzer"} } } } ```
请求返回{"acknowledged":true,"shards_acknowledged":true,"index":"archive_index"}即创建成功。
基于SpringBoot框架开发,先引入ES依赖,完整maven坐标如下:
```xml在application.yml添加ES配置:
```yaml spring: elasticsearch: uris: http://localhost:9200 connection-timeout: 5000 socket-timeout: 30000 ```核心检索服务层完整可复制代码如下,支持任意字段组合检索:
```java @Service public class ArchiveSearchService { @Resource private ElasticsearchRestTemplate elasticsearchRestTemplate; public PageResult所有检索字段均支持非必填任意组合,无需额外配置即可实现多条件逻辑与匹配,完全满足数字档案馆组合检索业务需求。
基于Vue2+ElementUI实现组合检索表单,完整可复制代码如下:
```vue