Error configuring elasticsearch Litium 7.4.0

So i´m sitting here trying to setup Elasticsearch for a brand new and clean accelerator (version 7.4.0)
First of all, the documentation (docs.litium.com/documentation/architecture/search/elasticsearch/setup-and-configure-elasticsearch) mentions this link for the plugin (github.com/bells/elasticsearch-analysis-dynamic-synonym) but this seems to be an really old version for like elasticsearch 5.x.

I found this git ( /Tasteful/elasticsearch-analysis-dynamic-synonym) which is a fork from the old one and seems to be alot newer.
Don´t know if this is a mistake in the documentation or if i should use a several year old version of elastic search.

I have succesfully built all indexes in the litium backoffice and my localhost:9200 seems to be working fine, but whenever i try to search for something (anything) in the accelerator, elasticsearch throws this error at me.

[2020-02-03T12:52:07,167][DEBUG][o.e.a.s.TransportSearchAction] [LAPTOP-BDH2SOIM] [productdocument.en-us][0], node[qy4vSGELTp-A81MTIscl4Q], [P], s[STARTED], a[id=ePgYruzeS6WsKwQu7vqegQ]: Failed to execute [SearchRequest{searchType=QUERY_THEN_FETCH, indices=[productdocument.en-us], indicesOptions=IndicesOptions[ignore_unavailable=false, allow_no_indices=true, expand_wildcards_open=true, expand_wildcards_closed=false, allow_aliases_to_multiple_indices=true, forbid_closed_indices=true, ignore_aliases=false, ignore_throttled=true], types=[], routing=‘null’, preference=‘null’, requestCache=null, scroll=null, maxConcurrentShardRequests=0, batchedReduceSize=512, preFilterShardSize=128, allowPartialSearchResults=true, localClusterAlias=null, getOrCreateAbsoluteStartMillis=-1, ccsMinimizeRoundtrips=true, source={“from”:0,“size”:20,“query”:{“bool”:{“must”:[{“bool”:{“filter”:[{“term”:{“channelSystemId”:{“value”:“11db52bf-cb6e-454e-80c0-b0be93ee7688”,“boost”:1.0}}},{“term”:{“assortments”:{“value”:“bdc7aada-7430-466b-b27c-f799fb683e3c”,“boost”:1.0}}},{“term”:{“organizations”:{“value”:“00000000-0000-0000-0000-000000000000”,“boost”:1.0}}}],“adjust_pure_negative”:true,“boost”:1.0}},{“bool”:{“should”:[{“match”:{“name”:{“query”:“a”,“operator”:“OR”,“analyzer”:“synonymAnalyzer”,“fuzziness”:“AUTO”,“prefix_length”:0,“max_expansions”:50,“fuzzy_transpositions”:true,“lenient”:false,“zero_terms_query”:“NONE”,“auto_generate_synonyms_phrase_query”:true,“boost”:10.0}}},{“match”:{“articleNumber”:{“query”:“a”,“operator”:“OR”,“analyzer”:“synonymAnalyzer”,“prefix_length”:0,“max_expansions”:50,“fuzzy_transpositions”:true,“lenient”:false,“zero_terms_query”:“NONE”,“auto_generate_synonyms_phrase_query”:true,“boost”:2.0}}},{“match”:{“content”:{“query”:“a”,“operator”:“OR”,“analyzer”:“synonymAnalyzer”,“fuzziness”:“AUTO”,“prefix_length”:0,“max_expansions”:50,“fuzzy_transpositions”:true,“lenient”:false,“zero_terms_query”:“NONE”,“auto_generate_synonyms_phrase_query”:true,“boost”:1.0}}}],“adjust_pure_negative”:true,“boost”:1.0}}],“filter”:[{“bool”:{“should”:[{“term”:{“permissions”:{“value”:“Group:5b521f8c-a7a2-44e0-ab76-1c60d740bded”,“boost”:1.0}}},{“term”:{“permissions”:{“value”:“Function/Websites/Content”,“boost”:1.0}}},{“term”:{“permissions”:{“value”:“Function/Media/Content”,“boost”:1.0}}},{“term”:{“permissions”:{“value”:“Function/Products/Content”,“boost”:1.0}}}],“adjust_pure_negative”:true,“boost”:1.0}}],“adjust_pure_negative”:true,“boost”:1.0}},“sort”:[{"_score":{“order”:“desc”}},{“name.keyword”:{“order”:“asc”}},{“articleNumber”:{“order”:“asc”}}]}}]
org.elasticsearch.transport.RemoteTransportException: [LAPTOP-BDH2SOIM][127.0.0.1:9300][indices:data/read/search[phase/query]]
Caused by: org.elasticsearch.index.query.QueryShardException: [match] analyzer [synonymAnalyzer] not found
at org.elasticsearch.index.query.MatchQueryBuilder.doToQuery(MatchQueryBuilder.java:408) ~[elasticsearch-7.5.1.jar:7.5.1]
at org.elasticsearch.index.query.AbstractQueryBuilder.toQuery(AbstractQueryBuilder.java:99) ~[elasticsearch-7.5.1.jar:7.5.1]
at org.elasticsearch.index.query.BoolQueryBuilder.addBooleanClauses(BoolQueryBuilder.java:394) ~[elasticsearch-7.5.1.jar:7.5.1]

at java.lang.Thread.run(Thread.java:830) [?:?]
[2020-02-03T12:52:07,172][DEBUG][o.e.a.s.TransportSearchAction] [LAPTOP-BDH2SOIM] All shards failed for phase: [query]
org.elasticsearch.index.query.QueryShardException: [match] analyzer [synonymAnalyzer] not found
at org.elasticsearch.index.query.MatchQueryBuilder.doToQuery(MatchQueryBuilder.java:408) ~[elasticsearch-7.5.1.jar:7.5.1]
at org.elasticsearch.index.query.AbstractQueryBuilder.toQuery(AbstractQueryBuilder.java:99) ~[elasticsearch-7.5.1.jar:7.5.1]

at java.lang.Thread.run(Thread.java:830) [?:?]

Don´t know if this is something that relates to the integration with Litium or if this only is something elasticsearch related. (sorry for the huge error msg).

I´m also getting

Elasticsearch.Net.ElasticsearchClientException: ‘The remote server returned an error: (400) Bad Request… Call: Status code 400 from: POST /productdocument.en-us/_search?typed_keys=true. ServerError: Type: search_phase_execution_exception Reason: “all shards failed”’

Did you use the forked one or the original one?

There’s some tasks that we’ve added to our developer education that goes about installing both Docker and Elasticsearch a bit differently. The task for Docker includes a .yaml file that installs the packages needed. While we examine the information on Docs, maybe could try them out.

Docker

Elasticsearch

I got elasticsearch working using those guides, thanks :slight_smile:

2 Likes

The code from bells and my fork (Tasteful) are mostly the same, but I added some build script and artifacts for the 7.5.1 version to easy build and use the plugin (see links to the education scripts).

Elasticsearchs (ES) plugins are version dependent and need updates for each version of ES, please feel free to create a PR if you need the plugin for another version.

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.