Get an overview of Apache Solr as an enterprise search server. Get to know the available alternatives and why the Solr is cool! Get Excited! Enterprise Search Solutions are ready to pick.
12. Solr, What is it…?
q O pen Source, Java application
q R uns as a standalone full-text
search server within any servlet
container
q U ses Lucene Java search library
as its core
26. Alternatives to Solr
q Use Google (GSA – has
integration problems).
q FAST (Stopped supporting
linux)
q Use Lucene (write code on
top of that)
27. Alternatives to Solr…(2)
q Use your Database (has
performance issues)
q Sphinx (written in C++)
q Commercial Libraries (e.g.
lucidimagination.com)
q Write your own
32. OPERATING SYSTEM SUPPORT
q All with a Java VM, including:
q Linux (all versions)
q Windows (all versions)
q MacOS (all versions)
q Unix variants
33. APP SERVER SUPPORT
q Apache Tomcat,
q Jetty,
q Resin,
q WebLogicTM,
q WebSphereTM,
q GlassFish,
q dmServerTM,
q JBossTM and many more
q Java JDK 1.5 or later [requirement]
34. INSTALLATION
1. Download the latest version of:
apache-solr & tomcat
2. Extract it:
$tar -xzvf ./apache-solr-1.4.1.tgz
$tar -xzvf ./apache-tomcat-6.0.35.tar.gz
35. INSTALLATION
3. copy the solr.war file in the tomcat
webapps folder:
$ cp apache-solr-1.4.1/dist/apache-
solr-1.4.1.war apache-tomcat-6.0.35/
webapps/solr.war
4. copy the example/solr directory into the
tomcat home directory
$ cp -r apache-solr-1.4.1/example/solr .
36. INSTALLATION
5. start the tomcat server
$ ./bin/startup.sh
6. Visit http://localhost:8080/
solr/admin/
40. INDEX DOCUMENTS
1. </add>
Add single/multiple documents
$doc = new SolrSimpleDocument( array(
new SolrSimpleField('id', ’aawaj-profile-' . $user->id),
new SolrSimpleField('service', 'aawaj'),
new SolrSimpleField('contentType', 'profile'),
new SolrSimpleField('dbId', (string)$user->id)
));
$this->solr->add($doc);
44. QUERY SYNTAXES (RDMS)
SELECT * FROM post WHERE
(topic LIKE ‘%apache%’ OR
author LIKE ‘%kabir%’)
OR (topic LIKE ‘%solr%’ OR
author LIKE ‘%frank%’) ORDER
BY id DESC