Different SOLR Search example and POC
--> cd solr-6.6.0
- Linux : bin/solr start
- Window : bin\solr.cmd start
- With different port : solr start -p 8984
bin/solr stop -p 8983
bin/solr status
- https://gist.github.com/maxivak/3e3ee1fca32f3949f052
- http://www.codewrecks.com/blog/index.php/2013/04/29/loading-data-from-sql-server-to-solr-with-a-data-import-handler/
- https://lucene.apache.org/solr/guide/6_6/running-solr.html
- https://wiki.apache.org/solr/DataImportHandler
NOTE : We need to start solr before creating core
- Goto solr-6.0.0/server/solr//lib
- Download following jars and place it here - a. mssql-jdbc-6.1.0.jre8 b. solr-dataimporthandler-6.6.0 c. solr-dataimporthandler-extras-6.6.0
- Now Goto solr-6.0.0/server/solr//conf
- Make changes to following file, you can place these files from this repo/conf folder a. data-import.xml b. managed-schema c. solrconfig.xml
- Restart Solr --> solr restart -p 8983
- Go to http://localhost:8983/solr/
- you can see core core dropdown.
- Once core is created a directory is automatically generated at (solr-6.6.0\server\solr) with following important files in conf (1. solrconfig.xml, 2. managed-schema.xml).
- create a data-import.xml file in conf folder of your core. Refer in this repo for example. (You can give any name of this file)
- Edit solrconfig.xml to configure data-import file (the name you provided in step 1). Add following line :
<lib dir="../lib/" regex="solr-dataimporthandler-\d.*\.jar" />
<requestHandler name="/dataimport" class="org.apache.solr.handler.dataimport.DataImportHandler">
<lst name="defaults">
<str name="config">data-import.xml</str>
</lst>
</requestHandler>- Restart Solr.
- Start SOLR
- Select core
- Goto Scheme menu option
- Click Add Field
- Give Field name and type and Check relevent checkbox
- Go To http://localhost:8983/solr/#
- Select core from dropdown
- Click dataimport
- Click Execute.