Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Solr für Volltext-Suche oder gleich als Datenbank Engine

Frank Neff
October 30, 2014

Solr für Volltext-Suche oder gleich als Datenbank Engine

Slides zum Talk an der Symfony Live Konferenz in Berlin 2014

Frank Neff

October 30, 2014
Tweet

More Decks by Frank Neff

Other Decks in Programming

Transcript

  1. Über mich Frank Neff ▪ Software Engineer @ YMC AG

    ▪ Lebt in Zurich, Schweiz ▪ Codet PHP und Java ▪ Student ▪ Open Source Enthusiast ▪ Multicopter Drohne Pilot ▪ Hobby-Fotograf ▪ frankneff.ch ▪ ymc.ch
  2. • Such-Server (Reverse Index) • Basiert auf Apache Lucene •

    Standalone oder Cluster • Skalierbar • Unterstützt diverse Formate • Stemmer, Stopwords, Facettierung • Gewichtung von Feldern
  3. Gespeicherter Index Token Index biz 2 example 1 hard 2,3

    how 1,3 index 1,3 show 1,2 solr 1,3 work 1,2,3 Index Document 1 This example shows how SOLR's tokenizing/indexing works... 2 Show-biz is hard work! 3 How hard is the work with a solr index? *stark vereinfacht
  4. ▪ ~500’000 Wörter (Duden) ▪ = max. Index-Tokens ▪ Wachstum

    des Indexes verringert sich / bleibt konstant ▪ Suche wird nicht langsamer Anzahl Artikel Index Grösse Index Grösse
  5. ▪ Feature-Complete Solr Library ◦ Geschrieben in PHP ◦ Facet

    support ◦ Query building API ◦ Plugin system ◦ DisMax support ▪ http://www.solarium-project.org/ Solarium
  6. MySQL entlasten MySQL Solr App index persist related articles query

    /create ... /article/42 result article content query result
  7. ▪ Komplexe Queries ▪ Operationen die “Full-Table-Scans” auslösen ▪ Between

    Abfragen ▪ Geo-Koordinaten ▪ Sortierte Listen ▪ Keine Datenbank-Last MySQL entlasten
  8. Document Store Solr App persist ordered / grouped list /create

    ... /incident/list result /search fulltext search result
  9. ▪ nelmio/solarium-bundle ▪ Schnelle Abfragen ▪ Sortierte Listen ▪ Volltextsuche

    “out of the box” ▪ Geeignet für grosse Dokumentarchive ▪ Keine Relationen Document Store
  10. ▪ Solr ist kein RDBMS! ▪ Hält viele Daten, unterstützt

    aber keine Strukturen ▪ Optionen ◦ Denormalisierung ◦ Object-Hydration (bspw. über Doctrine ORM) ◦ Polyglot-Persistence Relationen
  11. Object-Hydration MySQL Solr App persist /create /article/42 article User Artikel

    user by article index [hydrator] query result article + user
  12. ▪ floriansemm/solr-bundle ▪ Hydration über Solr-Index oder RDBMS ▪ Entity

    Annotation Support ▪ Indexierung anhand von Doctrine-Events ▪ Unterstützt Doctrine ORM/ODM Object-Hydration
  13. Polyglot Persistence Neo4j Solr App persist data persist structure data

    query /create ... /article/42 result structure query result
  14. ▪ Trennung von Daten und Struktur ▪ Synchronisierung auf Business-Logik

    Level ▪ Noch kein OSS-Bundle Polyglot Persistence
  15. ▪ Cluster-Betrieb ▪ High Availability ▪ Fault Tolerance ▪ Konfigurationsmanagement

    mit Zookeeper ▪ Benötigt Solr 4 ▪ cwiki.apache.org/confluence/x/ioDxAQ Solr Cloud
  16. ▪ Eingrenzung von Resultaten anhand verschiedener Filter ▪ A.k.a Explorative

    Suche ▪ Benutzer kann Filter selbst wählen und verknüpfen ▪ wiki.apache.org/solr/SolrFacetingOverview Faceting
  17. Web Solutions Big Data Analytics Mobile Danke ;) @frank_neff www.frankneff.ch

    www.ymc.ch github.com/frne speakerdeck. com/frne Bilder 1. http://bigdata.globant.com/?p=629 2. http://www.ecloudtimes.com/reduce-blog-loading-time/ 3. http://grabcad.com/ 4. http://www.colbenson.com/-/apache-solr-course-in-bilbao- tomorrow 5. http://www.solarium-project.org/ 6. http://office-lernen.com/ 7. https://forums.zarafa.com/ 8. https://plus.google.com/+RecordxpressCa/posts 9. https://www.simple-talk.com/sql 10. http://cloudconceptgroup.com/ 11. http://www.digitec.ch