# Can Hibernate Search support Chinese analyzer when it integrate with Elastic Search?

**URL:** <https://discourse.hibernate.org/t/can-hibernate-search-support-chinese-analyzer-when-it-integrate-with-elastic-search/2512>\
**Category:** Hibernate Search\
**Created:** [March 27, 2019, 8:58am UTC](https://discourse.hibernate.org/t/can-hibernate-search-support-chinese-analyzer-when-it-integrate-with-elastic-search/2512 "2019-03-27T08:58:40Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![andy](https://avatars.discourse-cdn.com/v4/letter/a/aeb1de/32.png) [@andy](https://discourse.hibernate.org/u/andy)\
**Post date:** [March 27, 2019, 8:58am UTC](https://discourse.hibernate.org/t/can-hibernate-search-support-chinese-analyzer-when-it-integrate-with-elastic-search/2512/1 "2019-03-27T08:58:41Z")

</div>

Can Hibernate Search support Chinese analyzer when it integrates with Elasticsearch?

---

<div class="post-metadata">

**Author:** ![yrodiere](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.hibernate.org/yrodiere/32/1760_2.png) [@yrodiere](https://discourse.hibernate.org/u/yrodiere)\
**Post date:** [March 27, 2019, 9:02am UTC](https://discourse.hibernate.org/t/can-hibernate-search-support-chinese-analyzer-when-it-integrate-with-elastic-search/2512/2 "2019-03-27T09:02:58Z")

</div>

If it’s just an analyzer like any other, there’s no reason it shouldn’t.

If there is something specific to this analyzer, maybe you can detail your concerns?

---

<div class="post-metadata">

**Author:** ![andy](https://avatars.discourse-cdn.com/v4/letter/a/aeb1de/32.png) [@andy](https://discourse.hibernate.org/u/andy)\
**Post date:** [March 27, 2019, 9:13am UTC](https://discourse.hibernate.org/t/can-hibernate-search-support-chinese-analyzer-when-it-integrate-with-elastic-search/2512/3 "2019-03-27T09:13:33Z")

</div>

Project running failed.

```auto

The analyzer implementation 'org.apache.lucene.analysis.cn.smart.SmartChineseAnalyzer' is not supported with Elasticsearch. Please only use builtin Lucene analyzers that have a builtin equivalent in Elasticsearch.

```

---

<div class="post-metadata">

**Author:** ![yrodiere](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.hibernate.org/yrodiere/32/1760_2.png) [@yrodiere](https://discourse.hibernate.org/u/yrodiere)\
**Post date:** [March 27, 2019, 9:37am UTC](https://discourse.hibernate.org/t/can-hibernate-search-support-chinese-analyzer-when-it-integrate-with-elastic-search/2512/4 "2019-03-27T09:37:11Z")

</div>

I think this is just a problem with the automatic translation from Lucene analyzers to Elasticsearch analyzers.

`SmartChineseAnalyzer` is not included by default with Hibernate Search: you had to include an additional dependency. Therefore Hibernate Search doesn’t know about this class, and cannot possibly recognize it and translate it to the Elasticsearch equivalent.

If you want to use it, you will have to:

1. Enable a plugin in your Elasticsearch cluster. See [https://www.elastic.co/guide/en/elasticsearch/plugins/5.6/analysis-smartcn.html](https://www.elastic.co/guide/en/elasticsearch/plugins/5.6/analysis-smartcn.html)
2. Use `@Analyzer(definition = "smartcn")` in your mapping (to refer the Elasticsearch analyzer directly by its name) instead of `@Analyzer(impl = SmartChineseAnalyzer.class)`

---

<div class="post-metadata">

**Author:** ![andy](https://avatars.discourse-cdn.com/v4/letter/a/aeb1de/32.png) [@andy](https://discourse.hibernate.org/u/andy)\
**Post date:** [March 27, 2019, 9:40am UTC](https://discourse.hibernate.org/t/can-hibernate-search-support-chinese-analyzer-when-it-integrate-with-elastic-search/2512/5 "2019-03-27T09:40:37Z")

</div>

Thank you very much!
