# Cannot search by Thai tag

**URL:** https://meta.discourse.org/t/cannot-search-by-thai-tag/160699
**Category:** Bug
**Created:** [August 13, 2020, 6:36am UTC](https://meta.discourse.org/t/cannot-search-by-thai-tag/160699 "2020-08-13T06:36:30Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![siriwatknp](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/siriwatknp/32/189740_2.png) [@siriwatknp](https://meta.discourse.org/u/siriwatknp)
#### Post date: [August 13, 2020, 6:36am UTC](https://meta.discourse.org/t/cannot-search-by-thai-tag/160699/1 "2020-08-13T06:36:30Z")

</div>

discourse version 2.6.0.beta1

These are example posts that have tag in Thai.

 ![image](https://global.discourse-cdn.com/meta/original/3X/e/9/e978d5603db55b0068b4fcc263fd4edfcb4ca21a.png)

When I go to search page and try to search with Thai character (no extra vowel) the results match the amount from tag filter.

 ![image](https://global.discourse-cdn.com/meta/original/3X/9/b/9b253db82996330af19f33feff4c37c441b993ed.png)  
 ![image](https://global.discourse-cdn.com/meta/original/3X/0/d/0dcb6d66f25d840fac4bc3b8baa0449e496b32f6.png)

However, when I search with extra vowel, there is no result found. (but in tag filter there are 17 posts)

 ![image](https://global.discourse-cdn.com/meta/original/3X/5/5/5501aa3d6ed2711478f5d12397c92eaba8a7ffa7.png)  
 ![image](https://global.discourse-cdn.com/meta/original/3X/f/9/f957c5dbb7c0e33018d629d076982ee349a778ee.png)

---

<div class="post-metadata">

### Author: ![neounix](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/neounix/32/215617_2.png) [@neounix](https://meta.discourse.org/u/neounix)
#### Post date: [August 13, 2020, 7:12am UTC](https://meta.discourse.org/t/cannot-search-by-thai-tag/160699/2 "2020-08-13T07:12:38Z")

</div>

> [@siriwatknp](#):
>
> However, when I search with extra vowel, there is no result found. (but in tag filter there are 17 posts)

Hi K. @siriwatknp and Sawatdee from Thailand,

I am guessing the app search engine has problems with almost all Thai vowels, (4) tone marks and (5) diacritics?

Reference:

 ![man20090100461](https://global.discourse-cdn.com/meta/original/3X/b/a/ba61d8be613834272f1bdd85009b2ab862c3e748.gif)

---

<div class="post-metadata">

### Author: ![siriwatknp](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/siriwatknp/32/189740_2.png) [@siriwatknp](https://meta.discourse.org/u/siriwatknp)
#### Post date: [August 13, 2020, 7:14am UTC](https://meta.discourse.org/t/cannot-search-by-thai-tag/160699/3 "2020-08-13T07:14:37Z")

</div>

Any suggestion about workaround for this issue?

---

<div class="post-metadata">

### Author: ![neounix](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/neounix/32/215617_2.png) [@neounix](https://meta.discourse.org/u/neounix)
#### Post date: [August 13, 2020, 7:16am UTC](https://meta.discourse.org/t/cannot-search-by-thai-tag/160699/4 "2020-08-13T07:16:43Z")

</div>

My first suggestion is to search the net for similar documented issues and try to find “the way” other search engines manage this layer of complexity; and then look at the Discourse code and see what changes might be required to improve this search algo.

OBTW: Have you tried other Thai char sets in your browser keyboard settings?

Note:

A quick search, I see some experts have proposed the “Two-Pass Search Algorithm” approach:

[https://www.cicling.org/2008/RCS-vol-33/07-Kruengkrai.pdf](https://www.cicling.org/2008/RCS-vol-33/07-Kruengkrai.pdf)

> 6 Conclusion  
> We have presented a discriminative learning approach for Thai morphological  
> analysis. We consider Thai morphological analysis as a search problem. We propose the two-pass search algorithm that finds the most likely path in the expanded search space. The objective of our algorithm is to increase the coverage  
> of word hypotheses based on probability estimation in the lattice. The experimental results on ORCHID corpus show that the two-pass search algorithm can  
> improve the performance over the standard search approach

See also: Computers and the Thai Language

[https://lexitron.nectec.or.th/KM\_HL5001/file\_HL5001/Paper/Inter%20Journal/krrn\_52085.pdf](https://lexitron.nectec.or.th/KM_HL5001/file_HL5001/Paper/Inter%20Journal/krrn_52085.pdf)

> This article explains the history of Thai language development for  
> computers, examining such factors as the language, script, and  
> writing system, among others. The article also analyzes characteristics  
> of Thai characters and I/O methods, and addresses key issues involved  
> in Thai text processing. Finally, the article reports on language  
> processing research and provides detailed information on Thai  
> language resources.

---

<div class="post-metadata">

### Author: ![tgxworld](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/tgxworld/32/106117_2.png) [@tgxworld](https://meta.discourse.org/u/tgxworld)
#### Post date: [August 25, 2020, 1:11am UTC](https://meta.discourse.org/t/cannot-search-by-thai-tag/160699/6 "2020-08-25T01:11:04Z")

</div>

@siriwatknp Can you provide me with the text and the search term in text so that I can try to reproduced the problem locally?

---

<div class="post-metadata">

### Author: ![tgxworld](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/tgxworld/32/106117_2.png) [@tgxworld](https://meta.discourse.org/u/tgxworld)
#### Post date: [August 25, 2020, 8:13am UTC](https://meta.discourse.org/t/cannot-search-by-thai-tag/160699/7 "2020-08-25T08:13:18Z")

</div>

@siriwatknp Just saw that you submitted a PR to fix this issue 🙂 The PR looks good to me and has been merged.

[https://github.com/discourse/discourse/pull/10488](https://github.com/discourse/discourse/pull/10488)

---

<div class="post-metadata">

### Author: ![tgxworld](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/tgxworld/32/106117_2.png) [@tgxworld](https://meta.discourse.org/u/tgxworld)
#### Post date: [August 25, 2020, 8:13am UTC](https://meta.discourse.org/t/cannot-search-by-thai-tag/160699/8 "2020-08-25T08:13:21Z")

</div>


