Liferay Elastic search error about max length limitation

thumbnail
Yan Paing, modified 6 Years ago. Regular Member Posts: 130 Join Date: 3/11/10 Recent Posts
Dear All,I tried to connect remote elastic search 6.5 server and found following error from elastic search. Can anyone suggest where should i do configuration.  And also i don't use localized_title_zh_CN but according to the log it is showing using it and throwing error.  Thank you 


[2019-05-21T05:59:18,798][DEBUG][o.e.a.b.TransportShardBulkAction] [LiferayElasticsearchnode] [liferay-20099][0] failed to execute bulk item (index) index {[liferay-20099][LiferayDocumentType][com.liferay.docs.guestbook.model.Entry_PORTLET_129525], source[n/a, actual length: [2.1kb], max length: 2kb]}
org.elasticsearch.index.mapper.MapperParsingException: analyzer [smartcn] not found for field [localized_title_zh_CN]
        at org.elasticsearch.index.mapper.TypeParsers.parseAnalyzersAndTermVectors(TypeParsers.java:112) ~[elasticsearch-6.5.0.jar:6.5.0]
        at org.elasticsearch.index.mapper.TypeParsers.parseTextField(TypeParsers.java:201) ~[elasticsearch-6.5.0.jar:6.5.0]
        at org.elasticsearch.index.mapper.TextFieldMapper$TypeParser.parse(TextFieldMapper.java:215) ~[elasticsearch-6.5.0.jar:6.5.0]
thumbnail
Christoph Rabel, modified 6 Years ago. Liferay Legend Posts: 1555 Join Date: 9/24/09 Recent Posts
You need to install the smartcn analyzer in the remote elasticsearch. There are four analyzers Liferay needs by default.
https://dev.liferay.com/discover/deployment/-/knowledge_base/7-0/installing-elasticsearch
If you can't do that, you could try to remove the chinese language globally in the instance settings. After doing that, try to do a full reindex of the portal. I am not sure, if that helps, but it might.
thumbnail
Yan Paing, modified 6 Years ago. Regular Member Posts: 130 Join Date: 3/11/10 Recent Posts
Thank you Christoph, now the max length issue is resolved. however while i tried to search the document then it is throwing following error again. This time it is saying spellCheckWorld_en_US. Could you please help?

[2019-05-21T11:22:37,212][DEBUG][o.e.a.s.TransportSearchAction] [LiferayElasticsearchNode] [liferay-20099][0], node[zLA6B9HNTQyr8-FkLUzBeQ], [P], s[STARTED], a[id=YUpkXXVBRKCcLBw7XGxlMQ]: Failed to execute [SearchRequest{searchType=QUERY_THEN_FETCH, indices=[liferay-20099], 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], types=[], routing='null', preference='null', requestCache=false, scroll=null, maxConcurrentShardRequests=5, batchedReduceSize=512, preFilterShardSize=128, allowPartialSearchResults=true, source={"suggest":{"spellCheckRequest":{"text":"addentrygb2_003","term":{"field":"spellCheckWord_en_US","size":1,"suggest_mode":"MISSING","accuracy":0.5,"sort":"SCORE","string_distance":"INTERNAL","max_edits":2,"max_inspections":5,"max_term_freq":0.01,"prefix_length":1,"min_word_length":4,"min_doc_freq":0.0}}}}}]
org.elasticsearch.transport.RemoteTransportException: [LiferayElasticsearchNode][xxx.xxx.xx.xxx:9300][indices:data/read/search[phase/query]]
Caused by: java.lang.IllegalArgumentException: no mapping found for field [spellCheckWord_en_US]
        at org.elasticsearch.search.suggest.SuggestionBuilder.populateCommonFields(SuggestionBuilder.java:307) ~[elasticsearch-6.5.0.jar:6.5.0]
        at org.elasticsearch.search.suggest.term.TermSuggestionBuilder.build(TermSuggestionBuilder.java:452) ~[elasticsearch-6.5.0.jar:6.5.0]
        at org.elasticsearch.search.suggest.SuggestBuilder.build(SuggestBuilder.java:175) ~[elasticsearch-6.5.0.jar:6.5.0]
        at org.elasticsearch.search.SearchService.parseSource(SearchService.java:815) ~[elasticsearch-6.5.0.jar:6.5.0]
        at org.elasticsearch.search.SearchService.createContext(SearchService.java:616) ~[elasticsearch-6.5.0.jar:6.5.0]