I have implemented lucene for my application and it works very well unless you have introduced something like japanese characters.
The problem is that if I have japanese string こんにちは、このバイネイです and I search with こ that is the first character than it works well whereas if I use more than one japanese character(こんにち)in search token search fails and there is no document found.
Are japanese characters supported in lucene? what are the settings to be done to get it working?
Built-in analyzer of lucene does not support japanese.
You need to install some analyzer like sen, which is java port of mecab, quite popular japanese analyzer, and its fast.
There is 2 sub types called
I don't think there can be an analyzer that will work for all languages. The problem is that different languages have different rules about word boundaries and stemming (for example, the Thai language doesn't use spaces at all to separate words). Or if there is, I certainly wouldn't want to be the maintainer!
What you will need to do is "tag" blocks of text as one language or another and use the correct analyzer for that particular language. You can attempt to detect the language "automatically" by doing character analysis (i.e. text using predominantly Japanese Katakana is likely Japanese)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With