JavaEye3.0 Development Notes-full-text search in Ruby

Source: Internet
Author: User
Tags solr web services

On the Java platform, Lucene is a desirable full-text search tool, Lucene performance, program stability, Third-party expansion and word segmentation algorithm, but in the ror aspect, not so lucky, Javaeye Web site to do full-text search, how to solve the problem of Full-text search?

On the Ruby platform, there are three ways to search for Full-text:

1, SOLR, ACTS_AS_SOLR

SOLR is a project of the Apache Open source organization, completely based on the latest version of Lucene, and provides a http/xml Web Services on the upper level of Lucene. SOLR's release package itself binds to the jetty6.0 application server and can be launched directly as a stand-alone Web service for Full-text search.

Because the way you communicate with SOLR is the standard HTTP based XML, you can use any programming language, Java,c++,ruby, Python. By sending the XML query request to SOLR and having SOLR run Lucene in the background, the return result is encapsulated in XML, and you can also have SOLR index it. Basically SOLR is the encapsulation of a Web service in Lucene. The advantage of SOLR is that it does a lot of caching optimizations for large-scale full-text searches, and is not limited to the types of clients because of XML.

ROR has a plugin called ACTS_AS_SOLR that encapsulates Ruby's access to SOLR, and if you prefer to use SOLR as a full-text search, ACTS_AS_SOLR is a good choice, and he can easily add full-text search to your ROR application. Given the stability of Lucene, this scheme is a pretty good choice.

But the disadvantage of this program is also obvious, your ROR application all Full-text search relies on the background again to send a Web request to SOLR server to obtain results, the speed of a single page is bound to be limited to the background of the cross-HTTP Web requests, which for the Full-text inspection Cable function relies on a lot of websites, I'm afraid it's hard to accept. Therefore, JavaEye3.0 does not use the SOLR scheme.

2, Sphinx

http://robbin.javaeye.com/blog/122696

I have introduced the Sphinx in the last blog. I personally very much favor Sphinx this independent third-party Full-text Search server, and can be combined with MySQL good, let alone its excellent performance. But the disadvantage of Sphinx is that there is no good word extension interface, it is a pure c development of services. This for Chinese word segmentation function support, it is difficult to achieve, and therefore have to regret the abandonment.

Related Article

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.