Solr Tutorials : sample php applications – Part 1

 Solr Sample web php application

Solr makes it easy to run a full-featured search server. In fact, its so easy, I’m going to walk you through Solr in 10 minutes. I will guide you on building a sample php application using SolR features like facets … As many shared hoster do not activate php solr extension, I will be working on my local computer with a wampserver php 5.3. To make solr work we must activate a php solr extension on apache. My php was build with compiler VC9 (see screenshot of my php info) so you must watch out for solr to be build with same compiler version. You can download my php solr here php_solr-5.3-svn20091122-vc9-x86.

wamp-build

Copy this dll in wamp php extensions directory and add line to your php.ini (extension=php_solr.dll) and restart all wamp services. returning to your browser check (http://localhost/?phpinfo=1) to see if Solr in activated like that.

wamp-solr

What is Solr ?

Apache Solr is a fast open-source Java search server.

Solr enables you to easily create search engines which searches websites, databases and files.

The goal of this post is to provide a gentle introduction into Solr through a series of tutorials.

How to use Solr quickly ?

If you want to start learning the heart of SolR, avoid the install problems for the moment by using OpenSolR SaaS platform.

Opensolr is a Solr Distributed Cloud Hosting  platform. Opensolr provides hosted instances of the Apache Solr server. In just seconds, you can create your own Solr server instance, manage it via our manager interface and integrate it with your custom application by using the standard Solr REST API. You can also quickly integrate your Solr instance with your favorite CMS by using its standart Solr plugin or module.

Once you have opened a free account on SolR like I did, you can connect to your account here and you can follow my first tutorial (coming soon).

In Open Solr You can create a generic collection salsa located on netherlands server :

opensolr1

 

Then you can open the setup collection and set your IP to test tutorials :

open solr Panel

 

 

Configuring Solr

A Solr installation comprises 3 parts:

  1. Server-related files, e.g. start.jar (Jetty), or Tomcat
  2. Solr webapp as a .war
  3. Solr Home which comprises configuration files and the data directory

Solr Home

Here’s a directory layout of a typical Solr Home directory.

| + conf
|     - schema.xml
|     - solrconfig.xml
|     - stopwords.txt etc
| + data
|     - index
|     - spelllchecker

The 2 most important files in the Solr configuration are:

  • schema.xml
  • solrconfig.xml (comming soon : not critical to start)

Cheers,

 

extradrmtech

Since 20 years I work on Database Architecture and data migration protocols. I am also a consultant in Web content management solutions. I am an experienced web-developer with over 10 years developing PHP/MySQL, C#, VB.Net applications ranging from simple web sites to extensive web-based business applications. When not writing code, I like to dance salsa and swing and have fun with my little family.

You may also like...

Leave a Reply