How to solve the Chinese search problem of Atlassian Confluence

Source: Internet
Author: User
Tags atlassian confluence
Atlassian confluence I think it is a wiki tool suitable for project development. Of course, it is commercial. If you are an open-source project, you can apply for an open-source license. however, the original program cannot search for Chinese. It uses Lucene 1.4, which means that Lucene's Chinese search is not used. (Of course, The Lucene package does not contain Chinese by default, in addition, confluence does not call related packages. Compared with Jira, it is still a problem. Of course, Jira can be configured at least without any Chinese characters.) through research, Lucene can use cjkanalyzer for Chinese search, despite such shortcomings, you can search for related files of confluence and find Lucene. cfg. XML, which calls a factory class: bucket. search. lucene. analyzer. defaultluceneanalyzerfactory and indexingsubsystemcontext. this class is also called in XML. You can write a class to replace this class, or modify the configuration file. open eclipse, create a new project, add the Lucene jar package, add the atlassian-bucket-0.6.9.jar to create a class to replace the original class, such as scudluceneanalyzerfactory code is as follows:
Package org. Apache. Lucene. analysis; import org. Apache. Lucene. analysis. CJK. cjkanalyzer; import bucket. Search. Lucene. analyzer. luceneanalyzerfactory; public class ScudluceneanalyzerfactoryImplements implements eanalyzerfactory
{
Public scudluceneanalyzerfactory ()
{
} Public analyzer createanalyzer ()
{
Return new cjkanalyzer ();
}
 
}
Compile, compress into a jar package, put it in the confluence WEB-INF/lib directory, modify the factory class in the configuration file mentioned above for your class. restart tomcat, re-index, OK, and search for Chinese characters (of course, English is fine) --- too detailed... this is not good.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.