Apache Solr! Enterprise Search Solutions at your Fingertips!

  • 4,099 views
Uploaded 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.

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 in: Technology
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
No Downloads

Views

Total Views
4,099
On Slideshare
0
From Embeds
0
Number of Embeds
4

Actions

Shares
Downloads
154
Comments
2
Likes
4

Embeds 0

No embeds

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
    No notes for slide

Transcript

  • 1. Apache-Solr!Enterprise Search Solutionsat your Fingertips! Murshed Ahmmad Khan@usamurai, murshed2k@gmail.com
  • 2. Presented at phpXpertsseminar 2011…
  • 3. Enterprise Search Server The criteria…
  • 4. Fast
  • 5. Flexible
  • 6. Powerful
  • 7. Scalable
  • 8. Relevant Results
  • 9. Production ready & Easy deployment
  • 10. What’s in yourmind, the name… ??
  • 11. Apache Solr!Fits all the above mentioned criteria…
  • 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. SOLR WORK FLOW…
  • 14. Solr History…q D eveloped at CNET Networks by Yonik Seeleyq D onated to ASF (Apache Software Foundation) in early 2006
  • 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. Solr - Features…
  • 17. Powerful Full-Text search…
  • 18. Hit Highlighting…
  • 19. Faceted Search…
  • 20. Tag Clouds…
  • 21. Geo-spatial search…
  • 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. 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. Solr - Features… (cont…)q  Flexible configurationq  Extensive Plugin architecture for advanced customizationq  Scalable distributed search, dynamic clustering, index replication
  • 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. 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. Who UseSolr/Lucene?
  • 28. Who use Solr/Lucene…More names: http://wiki.apache.org/solr/PublicServers
  • 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. 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. 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. 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. INSTALLATION5. start the tomcat server$ ./bin/startup.sh6. Visit http://localhost:8080/solr/admin/
  • 34. YOU ARE DONE…
  • 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. INDEX DOCUMENTS (INDEXER)The Common Loop
  • 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. INDEX DOCUMENTS2. </commit>Commit multiple documents atonce.$this->solr->commit();
  • 39. INDEX DOCUMENTS3. </optimize>Optimize, for performanceimprovement$this->solr->optimize();
  • 40. SOLR QUERY SYNTAXES
  • 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. QUERY SYNTAXES (SOLR)Topic:"The Right Way" ANDauthor:WrongGuy
  • 43. BOOSTING TERMS()topic: "jakartaapache"^4 "ApacheLucene"
  • 44. FUZZY SEARCH (SOLR)topic:roam~ (similar inspelling roam)matches foam roams, based onthe Levenshtein Distance, or EditDistance algorithm
  • 45. PROXIMITY SEARCH (SOLR)“jakarta apache”~10search for a "apache" and"jakarta" within 10 words ofeach other in a document
  • 46. SO, NOW,CAN I MAKE A MINI GOOGLE?
  • 47. YES, YOU CAN!q Apache NUTCH, already thereq Open source, Web-search software project.q Based on Solr...
  • 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. WHO AM I… murshed ahmmad Khanhead of development, http://www.usamurai.com@usamuraiemail: murshed2k@gmail.com
  • 50. THANKS…Questions?