Apache-Solr!Enterprise Search Solutionsat your Fingertips!  Murshed Ahmmad Khan@usamurai, murshed2k@gmail.com
Presented at phpXpertsseminar 2011…
Enterprise Search Server    The criteria…
Fast
Flexible
Powerful
Scalable
Relevant Results
Production ready & Easy deployment
What’s in yourmind, the name…      ??
Apache Solr!Fits all the above mentioned criteria…
Solr, What is it…?q O pen Source, Java applicationq R uns as a standalone full-text  search server within any servlet  c...
SOLR WORK FLOW…
Solr History…q D eveloped at CNET Networks  by Yonik Seeleyq D onated to ASF (Apache  Software Foundation) in early  2006
Solr History…(2)q I ncubation period ended in  january 2007 (v-1.2 released)q S olr is now maintained as a  subproject o...
Solr - Features…
Powerful Full-Text search…
Hit Highlighting…
Faceted Search…
Tag Clouds…
Geo-spatial search…
Solr – Features (cont..)q  Database integrationq  Rich document (Word, PDF)  handlingq  REST-like HTTP/XML, JSON APIs  ...
CLIENT API SUPPORT…q  Java (SolrJ),q  .NET (solrnet, SolrSharp),q  PHP (SolPHP),q  Python (SolPython),q  Ruby(on Rail...
Solr - Features… (cont…)q  Flexible configurationq  Extensive Plugin architecture  for advanced customizationq  Scalabl...
Alternatives to Solrq Use Google (GSA – has   integration problems).q  FAST (Stopped supporting  linux)q  Use Lucene (w...
Alternatives to Solr…(2)q  Use your Database (has    performance issues)q  Sphinx (written in C++)q  Commercial Librari...
Who UseSolr/Lucene?
Who use Solr/Lucene…More names: http://wiki.apache.org/solr/PublicServers
OPERATING SYSTEM SUPPORTq All with a Java VM, including:q Linux (all versions)q Windows (all versions)q MacOS (all ver...
APP SERVER SUPPORTq Apache Tomcat,q Jetty,q Resin,q WebLogicTM,q WebSphereTM,q GlassFish,q dmServerTM,q JBossTM an...
INSTALLATION1.  Download the latest version of:    apache-solr & tomcat2. Extract it:$tar -xzvf ./apache-solr-1.4.1.tgz$ta...
INSTALLATION3. copy the solr.war file in the tomcatwebapps folder:$ cp apache-solr-1.4.1/dist/apache-solr-1.4.1.war  apach...
INSTALLATION5. start the tomcat server$ ./bin/startup.sh6. Visit http://localhost:8080/solr/admin/
YOU ARE DONE…
CREATE SCHEMA.XML<field name="id" type="string" indexed="true"stored="true" required="true" /><field name="service" type="...
INDEX DOCUMENTS (INDEXER)The Common Loop
INDEX DOCUMENTS1.  </add>Add single/multiple documents$doc = new SolrSimpleDocument( array(            new SolrSimpleField...
INDEX DOCUMENTS2. </commit>Commit multiple documents atonce.$this->solr->commit();
INDEX DOCUMENTS3. </optimize>Optimize, for performanceimprovement$this->solr->optimize();
SOLR QUERY SYNTAXES
QUERY SYNTAXES (RDMS)SELECT * FROM post WHERE(topic LIKE ‘%apache%’ ORauthor LIKE ‘%kabir%’)OR (topic LIKE ‘%solr%’ ORauth...
QUERY SYNTAXES (SOLR)Topic:"The Right Way" ANDauthor:WrongGuy
BOOSTING TERMS()topic: "jakartaapache"^4 "ApacheLucene"
FUZZY SEARCH (SOLR)topic:roam~ (similar inspelling roam)matches foam roams, based onthe Levenshtein Distance, or EditDista...
PROXIMITY SEARCH (SOLR)“jakarta apache”~10search for a "apache" and"jakarta" within 10 words ofeach other in a document
SO, NOW,CAN I MAKE A MINI     GOOGLE?
YES, YOU CAN!q Apache NUTCH, already thereq Open source, Web-search   software project.q Based on Solr...
INTERESTED? READ MORE…Ø  http://lucene.apache.org/solr/Ø  http://wiki.apache.org/solrØ  http://lucene.apache.org/java/d...
WHO AM I…  murshed ahmmad Khanhead of development,  http://www.usamurai.com@usamuraiemail: murshed2k@gmail.com
THANKS…Questions?
Apache Solr! Enterprise Search Solutions at your Fingertips!
Apache Solr! Enterprise Search Solutions at your Fingertips!
Apache Solr! Enterprise Search Solutions at your Fingertips!
Upcoming SlideShare
Loading in...5
×

Apache Solr! Enterprise Search Solutions at your Fingertips!

4,889

Published on

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.

Published in: Technology
2 Comments
4 Likes
Statistics
Notes
No Downloads
Views
Total Views
4,889
On Slideshare
0
From Embeds
0
Number of Embeds
6
Actions
Shares
0
Downloads
169
Comments
2
Likes
4
Embeds 0
No embeds

No notes for slide

Apache Solr! Enterprise Search Solutions at your Fingertips!

  1. 1. Apache-Solr!Enterprise Search Solutionsat your Fingertips! Murshed Ahmmad Khan@usamurai, murshed2k@gmail.com
  2. 2. Presented at phpXpertsseminar 2011…
  3. 3. Enterprise Search Server The criteria…
  4. 4. Fast
  5. 5. Flexible
  6. 6. Powerful
  7. 7. Scalable
  8. 8. Relevant Results
  9. 9. Production ready & Easy deployment
  10. 10. What’s in yourmind, the name… ??
  11. 11. Apache Solr!Fits all the above mentioned criteria…
  12. 12. Solr, What is it…?q O pen Source, Java applicationq R uns as a standalone full-text search server within any servlet containerq U ses Lucene Java search library as its core
  13. 13. SOLR WORK FLOW…
  14. 14. Solr History…q D eveloped at CNET Networks by Yonik Seeleyq D onated to ASF (Apache Software Foundation) in early 2006
  15. 15. Solr History…(2)q I ncubation period ended in january 2007 (v-1.2 released)q S olr is now maintained as a subproject of Lucene
  16. 16. Solr - Features…
  17. 17. Powerful Full-Text search…
  18. 18. Hit Highlighting…
  19. 19. Faceted Search…
  20. 20. Tag Clouds…
  21. 21. Geo-spatial search…
  22. 22. Solr – Features (cont..)q  Database integrationq  Rich document (Word, PDF) handlingq  REST-like HTTP/XML, JSON APIs (so, you can code virtually in any language)
  23. 23. CLIENT API SUPPORT…q  Java (SolrJ),q  .NET (solrnet, SolrSharp),q  PHP (SolPHP),q  Python (SolPython),q  Ruby(on Rails) (rsolr, acts-as-solr, sunspot),q  C++,q  XML/HTTP,q  JSON/HTTP (AJAX Solr) ++q  PERL(SolPerl)
  24. 24. Solr - Features… (cont…)q  Flexible configurationq  Extensive Plugin architecture for advanced customizationq  Scalable distributed search, dynamic clustering, index replication
  25. 25. Alternatives to Solrq Use Google (GSA – has integration problems).q  FAST (Stopped supporting linux)q  Use Lucene (write code on top of that)
  26. 26. 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
  27. 27. Who UseSolr/Lucene?
  28. 28. Who use Solr/Lucene…More names: http://wiki.apache.org/solr/PublicServers
  29. 29. OPERATING SYSTEM SUPPORTq All with a Java VM, including:q Linux (all versions)q Windows (all versions)q MacOS (all versions)q Unix variants
  30. 30. APP SERVER SUPPORTq Apache Tomcat,q Jetty,q Resin,q WebLogicTM,q WebSphereTM,q GlassFish,q dmServerTM,q JBossTM and many moreq Java JDK 1.5 or later [requirement]
  31. 31. INSTALLATION1.  Download the latest version of: apache-solr & tomcat2. Extract it:$tar -xzvf ./apache-solr-1.4.1.tgz$tar -xzvf ./apache-tomcat-6.0.35.tar.gz
  32. 32. INSTALLATION3. copy the solr.war file in the tomcatwebapps folder:$ cp apache-solr-1.4.1/dist/apache-solr-1.4.1.war  apache-tomcat-6.0.35/webapps/solr.war4. copy the example/solr directory into thetomcat home directory$ cp -r apache-solr-1.4.1/example/solr .
  33. 33. INSTALLATION5. start the tomcat server$ ./bin/startup.sh6. Visit http://localhost:8080/solr/admin/
  34. 34. YOU ARE DONE…
  35. 35. CREATE SCHEMA.XML<field name="id" type="string" indexed="true"stored="true" required="true" /><field name="service" type="string" indexed="true"stored="true" required="true" /><field name="contentType" type="string" indexed="true"stored="true" required="true" /><field name="dbId" type="long" indexed="true"stored="true" /><field name="content" type="text" indexed="true"stored="true" /><copyField source="*" dest=”all” />
  36. 36. INDEX DOCUMENTS (INDEXER)The Common Loop
  37. 37. INDEX DOCUMENTS1.  </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);
  38. 38. INDEX DOCUMENTS2. </commit>Commit multiple documents atonce.$this->solr->commit();
  39. 39. INDEX DOCUMENTS3. </optimize>Optimize, for performanceimprovement$this->solr->optimize();
  40. 40. SOLR QUERY SYNTAXES
  41. 41. QUERY SYNTAXES (RDMS)SELECT * FROM post WHERE(topic LIKE ‘%apache%’ ORauthor LIKE ‘%kabir%’)OR (topic LIKE ‘%solr%’ ORauthor LIKE ‘%frank%’) ORDERBY id DESC
  42. 42. QUERY SYNTAXES (SOLR)Topic:"The Right Way" ANDauthor:WrongGuy
  43. 43. BOOSTING TERMS()topic: "jakartaapache"^4 "ApacheLucene"
  44. 44. FUZZY SEARCH (SOLR)topic:roam~ (similar inspelling roam)matches foam roams, based onthe Levenshtein Distance, or EditDistance algorithm
  45. 45. PROXIMITY SEARCH (SOLR)“jakarta apache”~10search for a "apache" and"jakarta" within 10 words ofeach other in a document
  46. 46. SO, NOW,CAN I MAKE A MINI GOOGLE?
  47. 47. YES, YOU CAN!q Apache NUTCH, already thereq Open source, Web-search software project.q Based on Solr...
  48. 48. INTERESTED? READ MORE…Ø  http://lucene.apache.org/solr/Ø  http://wiki.apache.org/solrØ  http://lucene.apache.org/java/docs/ scoring.htmlØ  http://lucene.apache.org/java/3_5_0/ queryparsersyntax.htmlØ  http://www.slideshare.net/erikhatcher/solr- search-at-the-speed-of-light http://www.slideshare.net/pittaya/using- apache-solr
  49. 49. WHO AM I… murshed ahmmad Khanhead of development, http://www.usamurai.com@usamuraiemail: murshed2k@gmail.com
  50. 50. THANKS…Questions?
  1. A particular slide catching your eye?

    Clipping is a handy way to collect important slides you want to go back to later.

×