Technology hub‎ > ‎Search and Crawl‎ > ‎

Build and run solr from source

Follow the below steps to change or add features to SOLR and build from source

1. Download desired version of SOLR at with source. File name might look like solr-4.7.0-src.tgz
2. Extract it to folder using 7-zip if windows. Easy to extract in Mac or Unix systems
3. In terminal/cmd go to solr directory (/extract_location/solr-4.7.0)
4.  (Optional to work in eclipse) Run "ant eclipse" command under /extract_location/solr-4.7.0 to create an eclipse project
5. Execute "ant compile" under /extract_location/solr-4.7.0 to compile Solr binaries
6. Execute "ant ivy-bootstrap" based on solr version that uses ivy
7. Under  /extract_location/solr-4.7.0/solr execute "ant dist" should create war and jar files under /extract_location/solr-4.7.0/solr/dist
8. Copy the war file  /extract_location/solr-4.7.0/solr/xxxsolr-<ver>-SNAPSHOT.war to /extract_location/solr-4.7.0/solr/example/webapps
9. Rename the file /extract_location/solr-4.7.0/solr/example/webapps/xxxsolr-<ver>-SNAPSHOT.war to solr.war
10. Run solr - Go to /extract_location/solr-4.7.0/solr/example/ execute "java -jar start.jar"

Continue reading to add sample data and test Solr by following steps below