Configure Solr5.5.1 and tomcat8solr5.5.1 in tomcat8 in windows

Source: Internet
Author: User
Tags solr query

Configure Solr5.5.1 and tomcat8solr5.5.1 in tomcat8 in windows
Preface

I have been in contact with Solr for more than a month. I want to pick up java by learning Solr. In windows, I used jetty and tomcat to deploy v4.x and v5.x. There are still some changes from 4.x to 5.x and 6.x. After setting up Solr, I used the method of calling the http interface and SolrNet to add, delete, modify, and query indexes. When I used SolrNet for development, I found that there were still errors in queries from time to time, I don't know if the Solr version is too high. In the course of studying Solr, I learned a little about how to build a platform, create an index, search for index data, and perform Chinese word segmentation by referring to the blogs of several masters. I will sort these information later. At the end of the article, I will post a link.

 

Solr Construction

1. Download The solr windows installation package. Here I use 5.5.1. Decompress the downloaded package. In version 5. X, example contains several entry-level unstructured files: csv, json, and xml. You can use the post. jar command to import data to get started. Server is used for deployment.

 

2. install Tomcat 8. Copy the webapp directory under the solr-5.5.1/server/solr-webapp folder to the Tomcat/webapps folder.Rename the webapp directory named solr..

3. Copy the jar package in the solr-5.5.1/server/lib/ext to the Tomcat/webapps/solr/WEB-INF/lib directory.

4. Create the solr_home folder on any drive letter (I created it on drive D ). Copy the solr-5.5.1/server/solr directory to solr_home. This directory is the directory you need to use to create the index instance Core. The configuration files (schema. xml) and indexes are stored here.

5. Copy the log4j. properties under the solr-5.5.1/server/resources to the Tomcat/webapps/solr/WEB-INF/classes directory. If classes does not exist, manually create it.

6. Configure web. xml. Open web. xml under Tomcat/webapps/solr/WEB-INF. Find the following configuration

<env-entry>       <env-entry-name>solr/home</env-entry-name>       <env-entry-value>/put/your/solr/home/here</env-entry-value>       <env-entry-type>java.lang.String</env-entry-type> </env-entry>

Release comments and modify env-entry-value to your solr_home address.My address is d:/solr_home/solr.

OK. Save. Restart tomcat by the way. Enter http: // localhost: 8080/solr/index.html in the browser. After the configuration is complete, enter http: // localhost: 8080/solr and press enter to prompt 404. 4.xdeployment. In this case, you can enter index.html. If it appears, your solr Admin UI is ready.

Create a Core

5.x does not have the default Core. You need to configure it yourself.Create the Core directory in d:/solr_home/solr. I name it univeral and copy the conf directory in the d:/solr_home/solr/configsets directory and create the data folder, conf put the configuration file and data put the index data). Open the Admin UI with Core Admin on the left. Enter name and instanceDir in the form into univeral. Click Add Core]

 

Create an index

Select the Core Selector in the lower-left corner of the Admin UI to find the universal instance you just created. Click to expand the menu. Select documents.

 

Note: When you click [Submit Document], you will be prompted that the Field title does not exist because this Field is not configured in your schema. xml. Under d:/solr_home/solr/univeral/conf, find managed-schema (the old version is schema. xml) and open the configuration field.

If Status: success appears on the right, the index is created successfully.

 

 

Search for cool knives

Click Query in the left-side Core instance menu of Solr Admin UI. Default q = *: * query all. The http get interface used by solr query. Including field filtering, keyword query, highlighting, and facet (vertical shard query), all input parameters in the get path.

 

Summary

At the beginning of Solr exploration, there are a lot of things that are not very clear. I want to create indexes, search interfaces, and Chinese Word Segmentation Based on. net and java. The following is my blog reference during the learning process.

Http://martin3000.iteye.com/blog/1330106

Http://www.cnblogs.com/zhangweizhong/p/5044858.html

Http://blog.csdn.net/qing419925094/article/category/2357449

 

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.