[SOLR]-Environment setup

Source: Internet
Author: User
Tags solr

The Java installation and tomcat installation are ignored here, And the solr-4.10.0 is used here

 

1. Download SOLR from Apache. Address:

Http://mirrors.hust.edu.cn/apache/lucene/solr/

 

2. Extract the solr-4.10.0

 

3. Copy the SOLR. War file in the solr-4.10.0 \ example \ webapps to the webapps folder in the tomcat installation directory.

 

4. Run tomcat. (Ignore how to run Tomcat), Tomcat will automatically decompress the SOLR. War file.

 

5. Delete the SOLR. War file. (Otherwise, Tomcat will be released once every time it is started)

 

6. Return to the webapps directory of Tomcat, and open the SOLR \ WEB-INF \ WEB. xml file in notepad.

Add the following code: at the end of the <web-APP/> node.

<env-entry>    <env-entry-name>solr/home</env-entry-name>    <env-entry-value>E:\solrhome</env-entry-value>    <env-entry-type>java.lang.String</env-entry-type> </env-entry>

As shown in the preceding code, you need to create a folder named solrhome on the drive.

 

7. Return to the unzipped solr-4.10.0 directory, open the folder: solr-4.10.0 \ example \ SOLR, copy all content to E: \ solrhome

 

8. Open the folder: solr-4.10.0 \ example \ Lib \ Ext, copy all jar packages to Tomcat's webapps \ SOLR \ WEB-INF \ Lib.

 

9. Run Web: http: // localhost: 8899/SOLR. The following figure is displayed:

 

10. Create a New mycore folder under the E: \ solrhome directory.

 

11. In the unzipped solr-4.10.0 \ example \ multicore directory, copy the core0 folder to E: \ solrhome \ mycore.

 

12. Create a new folder: mydocs in E: \ solrhome.

 

13. Copy the unzipped post. Jar under solr-4.10.0 \ example \ exampledocs to E: \ solrhome \ mydocs

 

14. Copy the ipod_other.xml file under the decompressed solr-4.10.0 \ example \ multicore \ exampledocs to E: \ solrhome \ mydocs

 

15. Create a core in SOLR web page:

 

16. Restart tomcat. (How to restart, ignore)

 

17. Open CMD and run the following statement: (you won't talk about how to run Java in the command line)

java -Durl=http://localhost:8899/solr/mycore/update -Ddata=files -jar post.jar ipod_other.xml

 

18. Select core in SOLR Web:

 

19. query test:

 

20. You can also directly use the URL to query:

http://localhost:8899/solr/mycore/select?q=name%3AB*&wt=json&indent=true&_=1410949535746

Return JSON:

{  "responseHeader":{    "status":0,    "QTime":0},  "response":{"numFound":1,"start":0,"docs":[      {        "id":"F8V7067-APL-KIT",        "name":"Belkin Mobile Power Cord for iPod w/ Dock",        "_version_":1479481822989516800}]  }}

 

[SOLR]-Environment setup

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.