Top Banner
Apache Solr search for Drupal Ievgen Kartakov http://donetsk.drupal.ua
27

Apache Solr search for Drupal. Ievgen Kartakov.

May 08, 2015

Download

Technology

DrupalCampDN
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Apache Solr search for Drupal. Ievgen Kartakov.

Apache Solr search for Drupal

Ievgen Kartakov

http://donetsk.drupal.ua

Page 2: Apache Solr search for Drupal. Ievgen Kartakov.

Apache Solr search for Drupal

Ievgen KartakovPropeople | Ukraine Department Manager

Nikname: creaoyEmail: [email protected]

Page 3: Apache Solr search for Drupal. Ievgen Kartakov.

CONTENTS

• Basic things. Installation, configuration, multisite setup

• Adding CCK fields to index, work with filters, theming results

• Solr vs. Sphinx

Page 4: Apache Solr search for Drupal. Ievgen Kartakov.

INSTALLATION

• Server software– Require root access and hands. – Possible to setup multiple search paths

• Hosting– Don’t require server configuration– Usually not cheap

Page 5: Apache Solr search for Drupal. Ievgen Kartakov.

CONFIGURATION

• Enable Drupal module– Configure host, port, patch variables– Select content types, configure weight

for index– Run cron and wait for 2 min

Page 6: Apache Solr search for Drupal. Ievgen Kartakov.

EXAMPLE: STANFORD CSI

Page 7: Apache Solr search for Drupal. Ievgen Kartakov.

MULTISITE SETUP

• Multiple site setup on one core• Useful for development server with different

sites• Hosting companies doesn’t support this

properly

Page 8: Apache Solr search for Drupal. Ievgen Kartakov.

ADDING CCK FIELDS TO INDEX

Page 9: Apache Solr search for Drupal. Ievgen Kartakov.

ADDING CCK FIELDS TO SEARCH QUERY

Page 10: Apache Solr search for Drupal. Ievgen Kartakov.

EXAMPLE: 4ALLPROMOS

Page 11: Apache Solr search for Drupal. Ievgen Kartakov.

FILTERS SEARCH RESULTS

• Content type and taxonomy filters supported• Faceted search by default• D6. What to do with non standard filters?

Page 12: Apache Solr search for Drupal. Ievgen Kartakov.

THEMING RESULTS PAGE

• Simple template changing and text output search-result.tpl.php

Page 13: Apache Solr search for Drupal. Ievgen Kartakov.

APACHE SOLR WITH…

• Apache Solr Views (Apache Solr + Views 3)– Output results with view without database query

• Apache Solr Panels (Apache Solr + Panels) – Build search page layout with panels

Page 14: Apache Solr search for Drupal. Ievgen Kartakov.

EXAMPLE: CULTIVATE

Page 15: Apache Solr search for Drupal. Ievgen Kartakov.

FILTERS CLOSER LOOK

Page 16: Apache Solr search for Drupal. Ievgen Kartakov.

D7: APACHE SOLR MODULE

• How to add fields into indexer (document)• How to execute results (if we need different

content types on page)• Faceted api (if we need custom blocks)

Page 17: Apache Solr search for Drupal. Ievgen Kartakov.

D7: ADDING TO INDEX

Page 18: Apache Solr search for Drupal. Ievgen Kartakov.

D7: EXECUTE THE SEARCH

Page 19: Apache Solr search for Drupal. Ievgen Kartakov.

D7: FACETED API

Page 20: Apache Solr search for Drupal. Ievgen Kartakov.

EXAMPLE: CASINO.AT

Page 21: Apache Solr search for Drupal. Ievgen Kartakov.

EXAMPLE: CASIONO.AT OVERLAY

Page 22: Apache Solr search for Drupal. Ievgen Kartakov.

SOLR VS. SPHINX

• Numbers? Nooo, just integration with Drupal– Both modules provide faceted search– Sphinx module for drupal 6 in dev but it works :)– Sphinx is not so popular in Drupal community– Indexing difference– How easy to integrate?

Page 23: Apache Solr search for Drupal. Ievgen Kartakov.

EXAMPLE: SPHINX CONFIG

Page 24: Apache Solr search for Drupal. Ievgen Kartakov.

EXAMPLE: SPHINX SEARCH RUN

Page 25: Apache Solr search for Drupal. Ievgen Kartakov.

EXAMPLE: JOBBX.SE

Page 26: Apache Solr search for Drupal. Ievgen Kartakov.

CONCLUSION

• Sphinx is fast (makes craigslist’s search fly)• With sphinx you can run indexes as you want• With sphinx you will enjoy your time

optimizing MySQL queries• But if you need good and fast solution just go

with Solr

Page 27: Apache Solr search for Drupal. Ievgen Kartakov.

Useful links

• CONFIGURING APACHE SOLR MULTI-CORE WITH DRUPAL AND TOMCAT ON UBUNTU 9.10

• Displaying CCK field data in Solr results• Comparison Between Solr And Sphinx Search

Servers