# Issue with using Thai Language Analyzer

**URL:** <https://discuss.elastic.co/t/issue-with-using-thai-language-analyzer/5402>\
**Category:** Elasticsearch\
**Created:** [September 19, 2011, 3:47am UTC](https://discuss.elastic.co/t/issue-with-using-thai-language-analyzer/5402 "2011-09-19T03:47:52Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Mishari](https://avatars.discourse-cdn.com/v4/letter/m/71c47a/32.png) [@Mishari](https://discuss.elastic.co/u/Mishari)\
**Post date:** [September 19, 2011, 3:47am UTC](https://discuss.elastic.co/t/issue-with-using-thai-language-analyzer/5402/1 "2011-09-19T03:47:52Z")

</div>

Hi,

I'm having an issue with the Thai Language Analyzer I have the  
following mapping defined:

{ u'parsedtext': { 'index': 'analyzed', 'store': 'yes', 'type':  
u'string', 'index\_analyzer': u'thai', 'search\_analyzer': u'thai' } }

and I've submitted the following sentence for indexing {"parsedtext":  
u"ฉันนั่งตากลม"} but for the benefit for those in the forum I will  
romanize it to "channangtaklom" (Thai language has no spaces between  
words).

Now, I can query for the string "tak" but I can't search for "taklom",  
what am I missing?

---

<div class="post-metadata">

**Author:** ![ppearcy](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ppearcy/32/980_2.png) [@ppearcy](https://discuss.elastic.co/u/ppearcy)\
**Post date:** [September 20, 2011, 10:11pm UTC](https://discuss.elastic.co/t/issue-with-using-thai-language-analyzer/5402/2 "2011-09-20T22:11:24Z")

</div>

Hey,  
This is a pretty lame answer, but I believe all this functionality  
is inherited directly from lucene. You may be able to get some more  
detailed answers on that discussion group. These ticket seems to track  
the ticket introducing this support, which may have some answers:  
[https://issues.apache.org/jira/browse/LUCENE-503](https://issues.apache.org/jira/browse/LUCENE-503)

Again, this isn't the answer I'd prefer to give, but if none of these  
yields much info, I'd recommend digging into the code.

Hope this is at least marginally helpful 🙂

Best Regards,  
Paul

On Sep 18, 9:47 pm, Mishari [misha...@gmail.com](mailto:misha...@gmail.com) wrote:

> Hi,
> 
> I'm having an issue with theThaiLanguage Analyzer I have the  
> following mapping defined:
> 
> { u'parsedtext': { 'index': 'analyzed', 'store': 'yes', 'type':  
> u'string', 'index\_analyzer': u'thai', 'search\_analyzer': u'thai' } }
> 
> and I've submitted the following sentence for indexing {"parsedtext":  
> u"©Ñ¹¹Ñè§µÒ¡ÅÁ"} but for the benefit for those in the forum I will  
> romanize it to "channangtaklom" (Thailanguage has no spaces between  
> words).
> 
> Now, I can query for the string "tak" but I can't search for "taklom",  
> what am I missing?

---

<div class="post-metadata">

**Author:** ![kimchy](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kimchy/32/44952_2.png) [@kimchy](https://discuss.elastic.co/u/kimchy)\
**Post date:** [September 20, 2011, 11:15pm UTC](https://discuss.elastic.co/t/issue-with-using-thai-language-analyzer/5402/3 "2011-09-20T23:15:46Z")

</div>

I had a chat with Mishari on IRC, and something is strange since the  
behavior from the stock Lucene ThaiAnalyzer was not as he expected when used  
with elasticsearch (though really, it just delegates to it). Mishari, any  
updates?

On Wed, Sep 21, 2011 at 1:11 AM, ppearcy [ppearcy@gmail.com](mailto:ppearcy@gmail.com) wrote:

> Hey,  
> This is a pretty lame answer, but I believe all this functionality  
> is inherited directly from lucene. You may be able to get some more  
> detailed answers on that discussion group. These ticket seems to track  
> the ticket introducing this support, which may have some answers:  
> [[LUCENE-503] Contrib: ThaiAnalyzer to enable Thai full-text search in Lucene - ASF JIRA](https://issues.apache.org/jira/browse/LUCENE-503)
> 
> Again, this isn't the answer I'd prefer to give, but if none of these  
> yields much info, I'd recommend digging into the code.
> 
> Hope this is at least marginally helpful 🙂
> 
> Best Regards,  
> Paul
> 
> On Sep 18, 9:47 pm, Mishari [misha...@gmail.com](mailto:misha...@gmail.com) wrote:
> 
> > Hi,
> > 
> > I'm having an issue with theThaiLanguage Analyzer I have the  
> > following mapping defined:
> > 
> > { u'parsedtext': { 'index': 'analyzed', 'store': 'yes', 'type':  
> > u'string', 'index\_analyzer': u'thai', 'search\_analyzer': u'thai' } }
> > 
> > and I've submitted the following sentence for indexing {"parsedtext":  
> > u"©Ñ¹¹Ñè§µÒ¡ÅÁ"} but for the benefit for those in the forum I will  
> > romanize it to "channangtaklom" (Thailanguage has no spaces between  
> > words).
> > 
> > Now, I can query for the string "tak" but I can't search for "taklom",  
> > what am I missing?

---

<div class="post-metadata">

**Author:** ![Mishari](https://avatars.discourse-cdn.com/v4/letter/m/71c47a/32.png) [@Mishari](https://discuss.elastic.co/u/Mishari)\
**Post date:** [October 18, 2011, 6:27pm UTC](https://discuss.elastic.co/t/issue-with-using-thai-language-analyzer/5402/4 "2011-10-18T18:27:48Z")

</div>

Hi,

It took a while before I could figure out what's going on. It seems  
that the tokenizer would come across a transliterated word and would  
either prepend a word or append one to it, so I suppose I should start  
digging into lucene then. Question is, if I fix the bug, then how can  
I get the patch into elasticsearch for use asap?

On Sep 21, 6:15 am, Shay Banon [kim...@gmail.com](mailto:kim...@gmail.com) wrote:

> I had a chat with Mishari on IRC, and something is strange since the  
> behavior from the stock Lucene ThaiAnalyzer was not as he expected when used  
> with elasticsearch (though really, it just delegates to it). Mishari, any  
> updates?
> 
> On Wed, Sep 21, 2011 at 1:11 AM, ppearcy [ppea...@gmail.com](mailto:ppea...@gmail.com) wrote:
> 
> > Hey,  
> > This is a pretty lame answer, but I believe all this functionality  
> > is inherited directly from lucene. You may be able to get some more  
> > detailed answers on that discussion group. These ticket seems to track  
> > the ticket introducing this support, which may have some answers:  
> > [[LUCENE-503] Contrib: ThaiAnalyzer to enable Thai full-text search in Lucene - ASF JIRA](https://issues.apache.org/jira/browse/LUCENE-503)
> 
> > Again, this isn't the answer I'd prefer to give, but if none of these  
> > yields much info, I'd recommend digging into the code.
> 
> > Hope this is at least marginally helpful 🙂
> 
> > Best Regards,  
> > Paul
> 
> > On Sep 18, 9:47 pm, Mishari [misha...@gmail.com](mailto:misha...@gmail.com) wrote:
> > 
> > > Hi,
> 
> > > I'm having an issue with theThaiLanguage Analyzer I have the  
> > > following mapping defined:
> 
> > > { u'parsedtext': { 'index': 'analyzed', 'store': 'yes', 'type':  
> > > u'string', 'index\_analyzer': u'thai', 'search\_analyzer': u'thai' } }
> 
> > > and I've submitted the following sentence for indexing {"parsedtext":  
> > > u"©Ñ¹¹Ñè§µÒ¡ÅÁ"} but for the benefit for those in the forum I will  
> > > romanize it to "channangtaklom" (Thailanguage has no spaces between  
> > > words).
> 
> > > Now, I can query for the string "tak" but I can't search for "taklom",  
> > > what am I missing?

---

<div class="post-metadata">

**Author:** ![kimchy](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kimchy/32/44952_2.png) [@kimchy](https://discuss.elastic.co/u/kimchy)\
**Post date:** [October 18, 2011, 9:15pm UTC](https://discuss.elastic.co/t/issue-with-using-thai-language-analyzer/5402/5 "2011-10-18T21:15:14Z")

</div>

If you manage to fix it, you can either have your own analyzers build from  
lucene and replace the lucene jar that comes with elasticsearch, or, create  
your own custom analyzer that is registered with elasticsearch.

On Tue, Oct 18, 2011 at 8:27 PM, Mishari [misharim@gmail.com](mailto:misharim@gmail.com) wrote:

> Hi,
> 
> It took a while before I could figure out what's going on. It seems  
> that the tokenizer would come across a transliterated word and would  
> either prepend a word or append one to it, so I suppose I should start  
> digging into lucene then. Question is, if I fix the bug, then how can  
> I get the patch into elasticsearch for use asap?
> 
> On Sep 21, 6:15 am, Shay Banon [kim...@gmail.com](mailto:kim...@gmail.com) wrote:
> 
> > I had a chat with Mishari on IRC, and something is strange since the  
> > behavior from the stock Lucene ThaiAnalyzer was not as he expected when  
> > used  
> > with elasticsearch (though really, it just delegates to it). Mishari, any  
> > updates?
> > 
> > On Wed, Sep 21, 2011 at 1:11 AM, ppearcy [ppea...@gmail.com](mailto:ppea...@gmail.com) wrote:
> > 
> > > Hey,  
> > > This is a pretty lame answer, but I believe all this functionality  
> > > is inherited directly from lucene. You may be able to get some more  
> > > detailed answers on that discussion group. These ticket seems to track  
> > > the ticket introducing this support, which may have some answers:  
> > > [[LUCENE-503] Contrib: ThaiAnalyzer to enable Thai full-text search in Lucene - ASF JIRA](https://issues.apache.org/jira/browse/LUCENE-503)
> > 
> > > Again, this isn't the answer I'd prefer to give, but if none of these  
> > > yields much info, I'd recommend digging into the code.
> > 
> > > Hope this is at least marginally helpful 🙂
> > 
> > > Best Regards,  
> > > Paul
> > 
> > > On Sep 18, 9:47 pm, Mishari [misha...@gmail.com](mailto:misha...@gmail.com) wrote:
> > > 
> > > > Hi,
> > 
> > > > I'm having an issue with theThaiLanguage Analyzer I have the  
> > > > following mapping defined:
> > 
> > > > { u'parsedtext': { 'index': 'analyzed', 'store': 'yes', 'type':  
> > > > u'string', 'index\_analyzer': u'thai', 'search\_analyzer': u'thai' } }
> > 
> > > > and I've submitted the following sentence for indexing {"parsedtext":  
> > > > u"©Ñ¹¹Ñè§µÒ¡ÅÁ"} but for the benefit for those in the forum I will  
> > > > romanize it to "channangtaklom" (Thailanguage has no spaces between  
> > > > words).
> > 
> > > > Now, I can query for the string "tak" but I can't search for  
> > > > "taklom",  
> > > > what am I missing?

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [July 6, 2017, 3:51am UTC](https://discuss.elastic.co/t/issue-with-using-thai-language-analyzer/5402/6 "2017-07-06T03:51:28Z")

</div>


