From 5504a592dc2a149acbc850b1eb9eed8aa93ff14c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Aliaksei=20Brown=E2=80=86?= <67626128+aliakseibrown@users.noreply.github.com> Date: Tue, 11 Nov 2025 14:09:48 +0100 Subject: [PATCH 1/2] Update Morfologik plugin version in ElasticSearch --- 004_ElasticSearch.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/004_ElasticSearch.md b/004_ElasticSearch.md index 63aae2f..92953e0 100644 --- a/004_ElasticSearch.md +++ b/004_ElasticSearch.md @@ -32,7 +32,7 @@ Utwórz plik `Dockerfile`: ``` FROM docker.elastic.co/elasticsearch/elasticsearch:8.19.4 RUN elasticsearch-plugin install --batch \ - pl.allegro.tech.elasticsearch.plugin:elasticsearch-analysis-morfologik:8.19.3 + pl.allegro.tech.elasticsearch.plugin:elasticsearch-analysis-morfologik:8.19.4 ENV discovery.type=single-node ENV xpack.security.enabled=false ``` @@ -82,7 +82,7 @@ docker compose up -d --build Po uruchomieniu: ``` -curl -s localhost:9200/_cat/plugins?v +curl -s 'localhost:9200/_cat/plugins?v' ``` Oczekiwany wynik: w kolumnie `component` pojawi się `analysis-morfologik`. From 04719b4214e9e27ce8dcf526b579f9b25c19d0af Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Aliaksei=20Brown=E2=80=86?= <67626128+aliakseibrown@users.noreply.github.com> Date: Tue, 11 Nov 2025 15:14:19 +0100 Subject: [PATCH 2/2] Fix index name from 'culturaX_pl' to 'culturax_pl' Fixed the error "reason": "Invalid index name [culturaX_pl], must be lowercase", --- 004_ElasticSearch.md | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/004_ElasticSearch.md b/004_ElasticSearch.md index 92953e0..6613652 100644 --- a/004_ElasticSearch.md +++ b/004_ElasticSearch.md @@ -92,7 +92,7 @@ Oczekiwany wynik: w kolumnie `component` pojawi się `analysis-morfologik`. ## 4. Tworzymy indeks i analizatory dla języka polskiego ``` -PUT /culturaX_pl +PUT /culturax_pl { "settings": { "analysis": { @@ -143,7 +143,7 @@ PUT /culturaX_pl ## 5. Wczytanie danych testowych ``` -POST /culturaX_pl/_bulk +POST /culturax_pl/_bulk { "index": {} } { "text_syn": "W kwietniu 2025 w Warszawie odbyła się konferencja AI.", "text_lem": "W kwietniu 2025 w Warszawie odbyła się konferencja AI.", "date": "2025-04-12" } { "index": {} } @@ -165,7 +165,7 @@ POST /culturaX_pl/_bulk ### 6.1. Synonimy miesięcy ``` -GET /culturaX_pl/_search +GET /culturax_pl/_search { "query": { "match": { "text_syn": "IV" } }, "highlight": { "fields": { "text_syn": {} } } @@ -179,7 +179,7 @@ powinno zwrócić dokument z *„kwietniu”* (synonimy: IV ↔ kwiecień) ### 6.2. Lematyzacja (fleksja rzeczowników) ``` -GET /culturaX_pl/_search +GET /culturax_pl/_search { "query": { "match": { "text_lem": "pies" } }, "highlight": { "fields": { "text_lem": {} } } @@ -193,7 +193,7 @@ powinno znaleźć „psu”, „psy”, „człowieka” — dzięki filtrowi `m ### 6.3. Fleksja nazwiska „Dąbrówka” ``` -GET /culturaX_pl/_search +GET /culturax_pl/_search { "query": { "match": { "text_lem": "Dąbrówka" } }, "highlight": { "fields": { "text_lem": {} } } @@ -225,7 +225,7 @@ znajdzie dokument z *„kwietniu”* mimo braku ogonka. ### 6.5. Podgląd tokenów (API `_analyze`) ``` -GET /culturaX_pl/_analyze +GET /culturax_pl/_analyze { "analyzer": "pl_syn_lemma", "text": "Profesor Dąbrówki analizował dane w kwietniu."