Node.js/ElasticSearch:修订间差异

来自康健生活
Kangkk​(留言 | 贡献)
Kangkk​(留言 | 贡献)
 
(未显示同一用户的2个中间版本)
第62行: 第62行:
Fri, 28 May 2021 11:00:32 GMT | Total Writes: 3455
Fri, 28 May 2021 11:00:32 GMT | Total Writes: 3455
Fri, 28 May 2021 11:00:32 GMT | dump complete
Fri, 28 May 2021 11:00:32 GMT | dump complete
</syntaxhighlight>|$|/home/kangkk}}
导入数据,创建索引
{{shc|<syntaxhighlight lang="bash">
curl -XPUT http://账号:密码@IP:端口/索引名称</syntaxhighlight>|$|/home/kangkk}}
开始导入
{{shc|<syntaxhighlight lang="bash">
./node_modules/elasticdump/bin/elasticdump --input ./索引名称_mapping.json --output http://账号:密码@IP:端口/ --type=mapping
./node_modules/elasticdump/bin/elasticdump --input ./索引名称.json --output http://账号:密码@IP:端口/ --type=data
</syntaxhighlight>|$|/home/kangkk}}
</syntaxhighlight>|$|/home/kangkk}}


=== taskrabbit/elasticsearch-dump ===
=== taskrabbit/elasticsearch-dump ===
=== 其他 ===
查看索引大小。
{{Shc_out|<syntaxhighlight lang="bash">
curl -X GET http://账号:密码@IP:端口/_cat/indices?v</syntaxhighlight>|<syntaxhighlight lang="bash">
health status index                    uuid                  pri rep docs.count docs.deleted store.size pri.store.size
green  open  .security-7              aGvmk0RpT0CJXkB46wN-lg  1  0        44            0    77.2kb        77.2kb
green  open  .kibana_task_manager_1  7E4IiOYTTHiPhzqVsE29ug  1  0          2            0      6.6kb          6.6kb
green  open  .apm-agent-configuration BEkeof_DQ8mtnbfn2PWwQA  1  0          0            0      283b          283b
yellow open  某个索引                kinMZdbPRSenXvSxeBewzA  1  1      3455            0    931.9kb        931.9kb
green  open  .kibana_1                WaiT4ix5RbOJV5Z_VOl92g  1  0        33            6    72.3kb        72.3kb
</syntaxhighlight>|$|/home/kangkk}}
== error ==
== error ==
* <code>Error Emitted => {"root_cause":[{"type":"mapper_parsing_exception","reason":"analyzer [ik_smart] not found for field [title]"}],"type":"mapper_parsing_exception","reason":"analyzer [ik_smart] not found for field [title]"}</code>
* <code>Error Emitted => {"root_cause":[{"type":"mapper_parsing_exception","reason":"analyzer [ik_smart] not found for field [title]"}],"type":"mapper_parsing_exception","reason":"analyzer [ik_smart] not found for field [title]"}</code>
: 没有安装IK分词器(elasticsearch-analysis-ik)


== 配置 ==
== 配置 ==