Solr: This is the Lucene based search api. Solr is open source enterprise search platform and written in Java, It provides the fast search with simple search, hit highlighting, faceted search, near real-time indexing, dynamic clustering, database integration, rich document (e.g., Word, PDF) handling, and geospatial search…. and much more. You can find the more detail here .
Requirments:
jdk 1.7 or greater
Installation:
Download from apache official website SOLR. Unzip the SOLR release and save ourselves in working directory.
1 2 3 4 5 |
[code] amit_anand@amit:~$ unzip -q solr-4.10.1.zip amit_anand@amit:~$ cd solr-4.10.1/ amit_anand@amit:~/solr-4.10.1$ [/code] |
We can run any Java servlet container, but SOLR release version contain jetty server and some examples so we can run SOLR sample application on the jetty.
1 2 3 4 5 6 7 8 |
[code] amit_anand@amit:~/solr-4.10.1/example$ java -jar start.jar 0 [main] INFO org.eclipse.jetty.server.Server – jetty-8.1.10.v20130312 54 [main] INFO org.eclipse.jetty.deploy.providers.ScanningAppProvider – Deployment monitor /home/amit_anand/solr-4.10.1/example/contexts at interval 0 81 [main] INFO org.eclipse.jetty.deploy.DeploymentManager – Deployable added: /home/amit_anand/solr-4.10.1/example/contexts/solr-jetty-context.xml 147 [main] INFO org.eclipse.jetty.webapp.WebInfConfiguration – Extract jar:file:/home/amit_anand/solr-4.10.1/example/webapps/solr.war!/ to /home/amit_anand/solr-4.10.1/example/solr-webapp/webapp ............. [/code] |
Now we can hit the http://localhost:8983/solr/ url in our browser and we can see our SOLR administration console on GUI mode
Indexing Data:
We can send all sample data using wild card like *.xml etc., In the example folder there is some sample xml file so we can use these sample files as an indexing data:
1 |
[code][/code] |
amit_anand@amit:~/solr-4.10.1/example/exampledocs$ java -jar post.jar *.xml
1 |
[code][/code] |
Now our SOLR application is ready to give us search results.
http://localhost:8983/solr/collection1/select?q=video&wt=python&indent=true
In this query we can change the format like json, python, xml, ruby, php, csv.
Recent Comments