1 / 27

Revolutionizing enterprise web development

Searching with Solr. Revolutionizing enterprise web development. What is Solr ?. Solr is the popular, blazing fast open source enterprise search platform from the Apache Lucene project. What’s Lucene ?

berny
Download Presentation

Revolutionizing enterprise web development

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Searching with Solr Revolutionizing enterprise web development

  2. What is Solr? • Solr is the popular, blazing fast open source enterprise search platform from the Apache Lucene project. • What’s Lucene? • Apache LuceneTM is a high-performance, full-featured text search engine library written entirely in Java. It is a technology suitable for nearly any application that requires full-text search, especially cross-platform.

  3. What is Solr? • Its major features include powerful full-text search, hit highlighting, faceted search, dynamic clustering, database integration, and rich document (e.g., Word, PDF) handling. • Solr is highly scalable, providing distributed search and index replication, and it powers the search and navigation features of many of the world's largest internet sites. • See http://lucene.apache.org/ for more info.

  4. Why Solr? • Why Solr or why Solr with Drupal?

  5. Where does it fit? • Sits beside your application servers in the stack • PHP communicates with the Solr servers (Apachesolr modules handles this for you) • Retrieve: URL strings • Push: XML packets

  6. Solr Setup • Options • Self-Hosted • http://lucene.apache.org/solr/ • Look for “Download Solrhere” • Service • Acquia • http://acquia.com/products-services/acquia-search

  7. Solr Setup • Example directory • Start.jar • java -jar start.jar &> /dev/null & • Solr directory • Conf directory • Schema.xml • Solrconfig.xml

  8. Solr Setup • Solr admin accessible here:http://localhost:8983/solr/admin

  9. Solr Setup • Schema.xml • Primarily handles what is indexed

  10. Solr Setup • Solrconfig.xml • Handles general configuration. • Might need to edit it for replication or if you plan to do file handling on the Solr server.

  11. Drupal + Solr • Core Module: Apachesolr • Optional Modules: • Apachesolr_multisitesearch • Self-explanatory • Apachesolr_attachments • Requires an additional Solr component (Tika). Allows full-text indexing of docs. • Apachesolr_views • Sorta…& maybe someday

  12. Drupal + Solr • BasicDrupalSettings

  13. Drupal + Solr • Examples of filters that can be surfaced

  14. Example: Drupal.org

  15. Example: Drupal.org

  16. Solr hooks • Add new data to the index • By default, all data displayed on the node view is indexed. We can also set up additional information to be indexed and/or filtered even if the information is not on the node page. • It’s worth taking a look at apachesolr_node_to_document (in apachesolr.index.inc)

  17. Solr hooks • hook_apachesolr_update_index (&$document, $node, $namespace) • Allows a module to change the contents of the $document object before it is sent to the Solr Server

  18. Solr hooks • Altering the query (3 possible methods) • hook_apachesolr_prepare_query(&$query, &$params, $caller) • Occurs before the query is cached • Modifications you make can be used by others

  19. Solr hooks

  20. Solr hooks • Altering the query (3 possible methods) • hook_apachesolr_modify_query(&$query, &$params, $caller) • Occurs after the query is cached • Modifications that you don’t want other modules to inherit

  21. Solr hooks

  22. Solr hooks • Altering the query (3 possible methods) • <caller>_finalize_query (&$query, &$params) • Occurs after the query is cached • Technically only for use by modules originating Solr queries (aka custom Solr search invocations, not the search page)

  23. Solr hooks • hook_apachesolr_search_result_alter(&$doc, &$extra) • Allows for modification of each search result independently

  24. Solr hooks • hook_apachesolr_process_results(&results) • Allows for modification of all search results

  25. Solr hooks • No technically a hook, but worth noting that search theming is identical to search module. • search-result.tpl.php • search-results.tpl.php • If you pass the same values from Solr as you had via node_load, the theming template becomes interchangeable.

  26. Summary • Apachesolr module provides a replacement for core Drupalsearch with better performance, scalability, and configuration thanDrupal default. • Solr requires a separate service running on Jetty or Tomcat. • hook_apachesolr_update_index provides a way to change what goes into the index. • hook_prepare_query, hook_modify_query and <caller>_finalize_query allow return modifications. • hook_apachesolr_search_result_alter & hook_apachesolr_process_results allow for result modification. Theming is the same as core.

  27. Thank You Bill O’Connor, CTO d.o: csevb10 t: csevb10 e: bill@achieveinternet.com

More Related