Apache Solr and Tomcat6 Search engine

阅读更多

Today, test the Solr and Tomcat6 search engine.

Now list the install and test case.

 

1.Download apache Solr(v1.2) And Tomcat6 from http://www.apache.org

 

2.Install Tomcat6 in C:/work/Tomcat/

 

3.unzip apache solr to a directory, and copy the /example/solr to C:/work/

 

4.and copy the war file from /dist,rename to solr.war to C:/work/Tomcat/webapps/

 

5.Configure JNDI for tomcat to reference to solr/home.

Create catalina/localhost folder  at C:/work/Tomcat/conf, and create solr.xml in C:/work/Tomcat/conf/catalina/localhost/,  xml file content is below:



 

6.now can run the  http://localhost:8080/solr to test the configuration correct or not.

 

7.modify the schema.xml ,please see the attached.

 

7. Create a test.xml at C:/work/solr/exampledoc  and fill with below data in it

 


  asid87f89asd7f9a
  Cybertron
  cbtron000
  1 Optimus Prime Way
  Prime City
  Optimus
  fd32as90
  +55555555 555.555.5555
  1000 lbs
  5x20x100
  enroute to destination planet from earth


  asid87f89asd7f9b
  Cybertronb
  cbtron0001
  1 Optimus Prime Wayb
  Prime Cityb
  Optimusb
  fd32as902
  +55555555 555.555.5556
  1100 lbs
  5x20x101
  enroute to destination planet from mar

 

8. Startup tomcat, and use the CMD to submit the index at c:/work/solr/exampledoc/

java -Durl=http://localhost:8080/solr/update -jar post.jar test.xml

 

9. Then use http://localhost:8080/solr to query the asid87f89asd7f9a in Solr/Lucene Statement

 

and will response the result.

 

  • schema.rar (5.2 KB)
  • 描述: zip
  • 下载次数: 24

你可能感兴趣的:(Solr,Apache,Tomcat,C,C++)