Using SOLR to build full-text search for enterprises (1) --- opening

Source: Internet
Author: User

After changing the work unit, the business type of the Project is changed. Full-text retrieval is required for the new project. Because the project is based on SQL Server, therefore, the old design uses the full-text search engine of SQL Server to implement full-text search. In the process of using the full-text retrieval function of SQL Server, it is found that many problems cannot be well solved, such as cache, in general, the cache of SQL Server, that is, the cache of execution plans and the page cache of query results, is far from enough, and it is difficult to adjust the cache parameters according to your own business needs. In addition, word segmentation for multiple languagesAlgorithmProblem: Although SQL Server has more than 50 built-in languages, it is not perfect. If you want to replace it, it should be very difficult. Highlighting is not yet supported, and faceting and field collapsing are widely used. The customer recommended that we use SOLR to improve the full-text search function, so I spent some time researching SOLR and intend to write someArticleTo sum up the use of SOLR, I hope it will help you.

I have talked a lot about it. Now let's get started.

first, let's introduce what SOLR is. To talk about SOLR, let's talk about Lucene first. Lucene is a full-text retrieval library Library Project of the Apache Foundation, which is open-source and developed using Java and has powerful functions, if you are interested, you can check out the community which is less active. The Apache Foundation no longer sponsors this subproject. If you want to integrate the full-text retrieval function into your system or extend the full-text retrieval function of luence, you should take a good look at Lucene. If you only want to use full-text search and do not want to study or intervene in the underlying algorithms and logic, SOLR may be a better choice. To put it simply, SOLR is an HTTP service implemented using the Lucene library. Of course, it also makes a lot of extensions. You can deploy SOLR in any Java serverlet container, such as Tomcat and jetty. You can use restful URLs to communicate with SOLR for document indexing and retrieval. In this way, the ease of use is greatly improved, because no matter what operating system platform your project is based on, what language is used for development, as long as you can communicate with the HTTP server, you can easily and quickly implement the full-text search function in your project. For more detailed understanding about SOLR, visit: http://lucene.apache.org/solr/

Next, we need to download and deploy SOLR. Slave. There are several preparations before installation. SOLR is implemented in Java, so there is no doubt that the Java Virtual Machine is required. Whether you install it on Windows or on Linux, click here to download JDK, after installing JDK, do not forget to check whether the java_home environment variable is set. In addition, if you plan to use tomcat, you must install Tomcat first and click here to download it. In fact, it is more convenient to use jetty in practice and practice. If you use SOLR on Windows, open the SOLR file package you just downloaded, use the DOS command line console to enter the example directory, and enter Java-jar start. jar, and press Enter. If there is no exception information, SOLR starts up. Now, open your browser and enter http: // localhost: 8983/SOLR/admin/To Go To The SOLR console, as shown in figure

Simple installation is complete, and you can index and query documents.

The beginning of today is here. We have prepared an environment. In the future, I will write a series of articles to introduce the use of SOLR.

Provide some information that helps you prepare the environment:

SOLR client for. Net -- the project owner on Google code is very active. If you submit issue or defect, he will continue to pay attention and feedback.

 

 

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.