tags:

views:

262

answers:

1

Hi, What I want to do is index some documents in Solr and know how it works. I have installed Solr and Tomcat and can see Solr Admin UI at localhost:8080/ solr/ admin/ Now, I want to add some documents to the index, may I know how to proceed further? I find very less documentation on Internet regarding this. In the tutorial http://lucene.apache.org/solr/tutorial.html#Indexing+Data they asked to run java -jar post.jar solr.xml monitor.xml command but after running that I get connection refused error as it is jetty. After installing jetty I tried telnet: I get "Connection refused" error

I am not able to understand what the problem is.

+2  A: 

As the manual states, there are several ways of indexing data into Solr:

  • Import records from a database using the Data Import Handler (DIH).
  • Load a CSV file (comma separated values), including those exported by Excel orMySQL.
  • Index binary documents such as Word and PDF with Solr Cell (ExtractingRequestHandler).
  • Use SolrJ for Java or other Solr clients to programatically create documents to send to Solr.

The post.jar script doesn't seem to be intended for uses other than testing. It's just a simplified implementation of a Solr client (handling only XML imports).

I've successfully used the DIH and a (PHP) Solr client for this purpose. The former is an extension to Solr that lets you map your data source (in my case MySQL) to the Solr index. Setting it up in the basic form is not difficult and it's quite well explained in the DataImportHandler section of the Solr Wiki. In case you prefer to control your indexing process (or part of it) at the software level, you can have a custom application that makes use one of the existing clients.

I'd suggest you try with one of these options.

nuqqsa