Successfully reported this slideshow.

Apache Solr! Enterprise Search Solutions at your Fingertips!

6

Share

Upcoming SlideShare
Apache Solr Workshop
Apache Solr Workshop
Loading in …3
×
1 of 53
1 of 53

Apache Solr! Enterprise Search Solutions at your Fingertips!

6

Share

Download to read offline

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.

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.

More Related Content

Related Books

Free with a 14 day trial from Scribd

See all

Apache Solr! Enterprise Search Solutions at your Fingertips!

  1. 1. Apache-Solr! Enterprise Search Solutions at your Fingertips! Murshed Ahmmad Khan @usamurai, murshed2k@gmail.com
  2. 2. Presented at phpXperts seminar 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 your mind, the name… ??
  11. 11. Apache Solr! Fits all the above mentioned criteria…
  12. 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
  13. 13. SOLR WORK FLOW…
  14. 14. Solr History… q D eveloped at CNET Networks by Yonik Seeley q 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 integration q  Rich document (Word, PDF) handling q  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 configuration q  Extensive Plugin architecture for advanced customization q  Scalable distributed search, dynamic clustering, index replication
  25. 25. Alternatives to Solr q 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 Use Solr/Lucene?
  28. 28. Who use Solr/Lucene… More names: http://wiki.apache.org/ solr/PublicServers
  29. 29. 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
  30. 30. 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]
  31. 31. 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
  32. 32. 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 .
  33. 33. INSTALLATION 5. start the tomcat server $ ./bin/startup.sh 6. 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 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);
  38. 38. INDEX DOCUMENTS 2. </commit> Commit multiple documents at once. $this->solr->commit();
  39. 39. INDEX DOCUMENTS 3. </optimize> Optimize, for performance improvement $this->solr->optimize();
  40. 40. SOLR QUERY SYNTAXES
  41. 41. 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
  42. 42. QUERY SYNTAXES (SOLR) Topic:"The Right Way" AND author:WrongGuy
  43. 43. BOOSTING TERMS() topic: "jakarta apache"^4 "Apache Lucene"
  44. 44. FUZZY SEARCH (SOLR) topic:roam~ (similar in spelling roam) matches foam roams, based on the Levenshtein Distance, or Edit Distance algorithm
  45. 45. PROXIMITY SEARCH (SOLR) “jakarta apache”~10 search for a "apache" and "jakarta" within 10 words of each other in a document
  46. 46. SO, NOW, CAN I MAKE A MINI GOOGLE?
  47. 47. YES, YOU CAN! q Apache NUTCH, already there q 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 Khan head of development, http://www.usamurai.com @usamurai email: murshed2k@gmail.com
  50. 50. THANKS… Questions?

×