Installing Solr on Windows

First Download the Solr
then install the Jetty server. download and extract in a folder in C drive.
and set the Java enviroment variable path.
then on the command prompt go to the jetty path and run the command java -jar start.jar
then on the browser run the URL localhost:8080 to check the working of jetty server
then extract the solr in any of your server folder on which you want to make the application like www/solr
then run the URL on browser http://localhost:8983
it will open the solr page.
to enable the PHP extention download the extention and extract in the PHP DLL folder and set the path
To connect with the MySql data base download the driver and install
then create a XML file like following and save it to the collection1 folder and named that data-config.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
<span style="font-family: Trebuchet MS, sans-serif;"><dataConfig
   
<dataSource type="JdbcDataSource" driver="com.mysql.jdbc.Driver"
url="jdbc:mysql://localhost:3306/bugzech" user="root"
password="tab" batchSize="1" /> 
    <document name="bugzech"
   
        <entity name="bugzech" query="SELECT * FROM login"
            <field column="id" name="id" /> 
            <field column="uname" name="uname" /> 
<field column="pwd" name="pwd" /> 
<field column="email" name="email" /> 
        </entity
   
    </document
</dataConfig
</span
</span>
Then add the following code in Solrconfig.xml to request to call the handler
1
2
3
4
5
6
<requestHandler name="/dataimport"
    class="org.apache.solr.handler.dataimport.DataImportHandler">
   <lst name="defaults">
     <str name="config">data-config.xml</str>
   </lst>
 </requestHandler>

Comments

Popular Posts