Postgresql 과 Elasticsearch 를 연동시키는 Zombodb 라는 플러그인을 설치하는 방법을 설명합니다.
출처 : Github zombodb
Zombodb install
Zombodb configuration
zombodb–10-1.0.3.sql
CentOS 6 (installed by yum)
PATH /usr/pgsql-10/share/extension/zombodb--10-1.0.3.sql
Mac OS (installed by brew)
PATH /usr/local/Cellar/postgresql@10/10.6_1/share/postgresql@10/extension/zombodb--10-1.0.3.sql
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
INSERT INTO analyzers(name, definition, is_default) VALUES (
'zdb_korean', '{
"type": "custom",
"tokenizer": "nori_tokenizer",
"filter": [
"lowercase",
"nori_part_of_speech"
]
}', true);
CREATE DOMAIN text_ko AS text;
-- INSERT INTO type_mappings(type_name, definition, is_default) VALUES (
-- 'text', '{
-- "type": "text",
-- "copy_to": "zdb_all",
-- "fielddata": true,
-- "analyzer": "zdb_standard"
-- }', true);
INSERT INTO type_mappings(type_name, definition, is_default) VALUES (
'text_ko', '{
"type": "text",
"copy_to": "zdb_all",
"analyzer": "zdb_korean"
}', true);
CREATE DOMAIN korean AS text; -- nori_analyzer
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
{
"error": {
"root_cause": [
{
"type": "mapper_parsing_exception",
"reason": "analyzer [korean] not found for field [sentence]"
}
],
"type": "mapper_parsing_exception",
"reason": "Failed to parse mapping [doc]: analyzer [korean] not found for field [sentence]",
"caused_by": {
"type": "mapper_parsing_exception",
"reason": "analyzer [korean] not found for field [sentence]"
}
},
"status": 400
}
끝! 읽어주셔서 감사합니다.