Solr in Drupal

46
Bringing Solr to Drupal A General and a Library-Specific Use Case Király Péter eXtensible Catalog 1

description

Presentation held at Apache Lucene EuroCon 2010 (http://lucene-eurocon.org/)

Transcript of Solr in Drupal

Page 1: Solr in Drupal

Bringing Solr to DrupalA General and a Library-Specific Use Case

Király PétereXtensible Catalog

1

Page 2: Solr in Drupal

2

Two ways of using Solr in DrupalGeneral solution: Apache Solr Search Integration and related

modules: Stats, Autocomplete, Multisite, Ajax, Biblio, Attachments, Übercart (e-commerce integration), Views, Multilingual, Geospatial and many othersFits for the overall needs, uses predefined fields

Library specific solution: eXtensible Catalog modulesFits for library needs, uses dynamic fields

Page 3: Solr in Drupal

3

Part 1 – the general solutionGeneral solution: Apache Solr Search Integration and related

modules: Stats, Autocomplete, Multisite, Ajax, Biblio, Attachments, Übercart (e-commerce integration), Views, Multilingual, Geospatial and many othersFits for the overall needs, uses predefined fields

Library specific solution: eXtensible Catalog modulesFits for library needs, uses dynamic fields

This part of the presentation is based on the works and previous presentations ofRobert Douglass.

Page 4: Solr in Drupal

4

Drupal architecture

Relational databasefor storage

Solr index for search

Page 5: Solr in Drupal

5

Purposes

Creating a general insfrastructure which is usable in every Drupal installation

Core module, and additional module for covering specific Solr functionalities (statistics, autocomplete etc.)

Replace the original (and still default) MySQL-based search feature

Page 7: Solr in Drupal

7

categories

API version

module search

sort

List of modules page

Page 14: Solr in Drupal

14

Solr in Views integration

Views is a very popular module, helps creating interactive DB queries andresult pages. Now it can handle Apache Solr as data source.

Page 15: Solr in Drupal

15

Part of the Views admin page

You can specify fields,

sorting, filters, layout,arguments, behaviours and more

Page 19: Solr in Drupal

19

CCK date searching

Content Construction Kit: popular module to create document and field types. CCK date is a special field type handling dates.

Page 20: Solr in Drupal

20

statistics

impressive numbers – that’s why welove Solr…

Page 23: Solr in Drupal

23

Future plansCrawling with Nutch

Geospatial search

eDismax (Solr 1.5)

Drupal 7

API changes

Improving documentation

Page 24: Solr in Drupal

24

People behind these modulesRobert Douglass (DE) http://drupal.org/user/5449

Alejandro Garza (MX) http://drupal.org/user/153120

Peter Wolanin (US) http://drupal.org/user/49851

James McKinney (CA) http://drupal.org/user/472460

Scott Reynolds (US) http://drupal.org/user/60009

Mike O'Connor (US) http://drupal.org/user/104525

Markus Kalkbrenner (DE) http://drupal.org/user/124705

and others…

Page 25: Solr in Drupal

25

Links apachesolr http://drupal.org/project/apachesolr (this is the best starting point)

content recommendation patch http://drupal.org/node/372767

views integration http://drupal.org/project/apachesolr_views, http://acquia.com/node/911667

file search http://drupal.org/project/apachesolr_attachments, http://acquia.com/node/1129446

date facet for CCK field http://drupal.org/node/558160

statistics http://drupal.org/project/apachesolr_stats

multisite http://drupal.org/project/apachesolr_multisitesearch

autocomplete http://drupal.org/project/apachesolr_autocomplete

Page 26: Solr in Drupal

26

Part 2 – Library specific solutionGeneral solution: Apache Solr Search Integration and related

modules: Stats, Autocomplete, Multisite, Ajax, Biblio, Attachments, Übercart (e-commerce integration), Views, Multilingual, Geospatial and many othersFits for the overall needs, uses predefined fields

Library specific solution: eXtensible Catalog modulesFits for library needs, uses dynamic fields

Page 27: Solr in Drupal

27

About eXtensible Catalog

a project creating an open source next generation library ‘discovery interface’ and an FRBR-based metadata platform

started in 2007

driven by new theories of library science, cultural anthropology and the practice of web 2.0, library 2.0

Universities of Rochester, Notre Dame, Cornell, North Carolina at Charlotte, Rochester Institute of Technology and CARLI consortium

Page 28: Solr in Drupal

28

Architecture Drupal CMS

Integrated Library System Repository

XC Metadata Services Toolkit

XC OAI ToolkitXC NCIP Toolkit

MARC NormalizationDC Normalization

Aggregation Transformation

XC Drupal Toolkit

circulation data

Page 29: Solr in Drupal

29

Purposes of XC Drupal Toolkit integrate library data into a popular content management system

customizable functionalities

customizable interface(s)

internationalization, localization

5000+ custom modules, 20+ library specific modules

wide range on mashup options

all features are available through user interfaces

Page 30: Solr in Drupal

30

Search results

highlighted terms

availability information

bibliographical data

cover images

facets

Page 33: Solr in Drupal

33

XML attribute handling<subject type="OCLC">History</subject>

subject=„History” and subject_OCLC=„History”subject_OCLC=„History”subject=„History” and subject_type=„OCLC”nonecould be indexed as…

Page 35: Solr in Drupal

35

Setup a facet

Aggregating values ofdifferent fields into onefacet

custom PHP code to modify field values(conditions)

specifySolr type

Page 37: Solr in Drupal

37

Getting records into Drupal: OAI harvesting

Harvest is running

List of scheduled harvests

Page 38: Solr in Drupal

38

Data flow between components

OAI-PMHprovider Drupal

MySQL Solr

batch delete/insert documentscreating nodes

Page 39: Solr in Drupal

39

Creating a ‘more like this’ parameter set

Saving parameters for ‘More like this’ functionality

Page 40: Solr in Drupal

40

Creating highlighter

wrapper around the highlighter’s parameters

Page 41: Solr in Drupal

41

Setting up field and date facet properties

Date facet properties

Field facet properties

Page 42: Solr in Drupal

42

Putting facets together: ‘facet group’

List of facets, and their type

General properties

Page 43: Solr in Drupal

43

Reordering facets

Just drag and drop

You haven’t saved changes!

Page 44: Solr in Drupal

44

Using facet term list in search form

dropdown fullfilled withlanguagefacet terms dropdown definition

Page 45: Solr in Drupal

45

Adding widgets to UI: navigation bar

definition of navigation bar

navigation bar in action

Page 46: Solr in Drupal

46

Links Project page http://eXtensibleCatalog.org

XC Drupal Toolkit http://drupal.org/project/xc

Metadata Services Toolkit http://code.google.com/p/xcmetadataservicestoolkit

OAI Toolkit http://code.google.com/p/xcoaitoolkit

NCIP Toolkit http://code.google.com/p/xcnciptoolkit

Developers:

Mlen-Too Wesley (GH) http://drupal.org/user/318924

Király Péter (H) http://drupal.org/user/352587, http://twitter.com/kiru