Friday, February 25, 2011

SolrJ cookbook - Setup

Solr makes searching much easier for your web applications in any programming languages. I will write a series of posts about how to use its Java client, solrJ.

Here is the first part, all about how to setup solrJ in your project. I'm using Maven and Spring framework.

1. Add solrJ dependency in your pom.xml:
  
   org.apache.solr
   solr-solrj
   ${solr.version}
  

2. Define Solr Server in your Spring applicationContext.xml
 
   
3. Autowire solrServer in your code
 @Autowired
 private SolrServer solrServer;

0 comments: