Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.
INTRO TO SEARCH
IN DRUPAL 7
Create an optimal search experience
Welcome!
SECTION 1:
WHAT ARE WE
SEARCHING FOR?
Introduction
We need search!
The problem
Why do you need search?
• Commerce - increase sales?

• Large amounts of data?

• Connecting people to information?

!
• S...
Our sample travel site
• Administration > Structure > Content types

• Administration > Reports > Field list
Core search - what’s
in the box?
We need a search page!
Drupal 7 core search
• Interval defines how often updated content is
being processed and sent to the index.
Cron.php
Indexi...
Core search indexing
• HTML Tag Scores!
• <H1> scored at 25 !
• <H2> scored at 18!
• Headings have higher
scores than cont...
Core search limitations
• SQL Not optimized
for full text search!
• Limited Operators!
• Slow/not scalable!
• Stemming hap...
Demo: Core search
• Load up Drupal core search

• Confusing UI

• Advanced search? Users don’t use it.

• Confusing UI of ...
Exercise 1: Core search
configuration
• Load up Drupal core search

• Confusing UI

• Advanced search? Users don’t use it....
Dead ends....
• A bad landing page, with no suggestions.

• “Don’t make me think”.
What are
alternatives?
Alternatives to core search
• Full services:!
• Google’s Custom
Search !
• Google Search
Appliance!
!
• Indexing software:...
Apache Solr
• Based on Lucene!
• Written in Java; uses
container such as
Tomcat or Jetty!
• Mathematical
Indexing!
• Repli...
Apache Solr
• Separate Server!
• Indexes your site!
• Widely used and
tested
GET (POST)
Search
*SQL
Web
ServerPOST
index
S...
Integrating Apache
Solr and Drupal
Integrate Solr w/ Drupal
• Search API

• Apache Solr Search Integration
Customizing Solr
• Improve the Index

• What Solr is storing

• How Solr indexes information

• Improve the Query

• What ...
SECTION 2:
CONFIGURE SOLR
SEARCH IN DRUPAL
Getting set up
What comes with
Solr?
Comparisons
Core index config Solr index config
Available with Solr
Spell checking Bias settings Suggestions
“More like this”
• Example from NIH.gov: 

Instead of using Entity reference fields.

• You can configure multiple suggestio...
Sorting options
• A block to allow users to alter sort.
Demo: What comes
with Solr?
• Enable the modules. 

• Index the site. What is indexed?

• Spelling correction offered out o...
Exercise 2: Configure Solr search
• A. Ensure search is installed and enabled

• B. Index site

• C. Review default result...
SECTION 3:
HOW TO IMPROVE
SEARCH
Boosting relevant results
Ways to optimize
search
Optmization options
• Phrases

• Search for sentences, phrases

• Optimize search for specific use cases

• More recent con...
Demo: Optimize results
• Bias settings

• When changes take effect

• Before and after examples
Exercise 3:
Optimize your search results
A.Test search before changes

B.Improve the result biases

C.Testing the changes;...
SECTION 4:
FACETS AND
WIDGETS
Filtering and displaying results
Facets: What users
want
Facets provide useful filters
Shows what
it’s filtered on
Bravo.com, Drupal site
Select content
.net magazine, Drupal site
Offer facets people need
Do clients sort by
name?
Use facets and
sorting which
influence
decisions.
!
Material
Color, etc
...
Tips to define facets
• Listen to users

• Analyze query logs to define facets. 

• Use popular words to label facets.

• C...
How are our users searching?
• What facets would you enable on this site?
Facets API in Drupal
About Facets
• For each facet you configure:

• A display widget

• A corresponding query type. 

• A block to place, some ...
Example display widgets
With Facet API Additional modules
Links Tag cloud 

drupal.org/project/facetapi_tagcloud
Links wit...
Demo: Configuring facets
• Enable the module.

• Review options for configuring facets for
different displays.

• Display wi...
Exercise 4:
Configure a facet slider
• A. Configure the facet options

• B. Place the population facet block

• C. Test the...
SECTION 5:
HOW TO IMPROVE
USER EXPERIENCE
The user experience
Established standards
• Users expect the search form to be... where?

• Queries

• Should be easy to refine

• Incremental ...
Beyond the defaults
• Limitations:

• Default results don’t show relevant data specific to
your site: dates, numerical data...
Options to improve
experience
Making improvements
Configure search page
Search page options
• How many results?

• Enable spell check?

• Show search box?

• Enabled Facets?
Facet block placement
• Double check your facet block configuration. 

• Where to display? Search box in header?
Demo: Apache Solr
Autocomplete
• Enable Apache Solr Auto Complete.

• Uses stemming so verb forms are picked up
as well.

...
Demo: Rich snippets
• Replicates Google’s results; Needs RDF!
Tip: If you install
this during demo,
please ensure to
disab...
Demo: Search page
configuration
• Where you configure Pages/blocks

• Demo how to change options
Next: Manage display
• Control the display for “Search results”

• Limited options; only fields
Display Suite for
Search results
Display Suite!
• Display Suite +
Display Suite Search !
• (and Display Suite UI)!
• Custom layout!
• Select which fields to...
Example
Header
Left
Footer
Right
Display suite
• Access items which aren’t “fields”
View modes
• Add “view modes” for specific control
Display Suite regions
• Variety of layouts
Arrange fields in regions
Demo: Display Suite
• Enable Display Suite, Display Suite Search,
Display Suite UI

• Modify display and change layout for...
Exercise 5: Improve display
with Display Suite
• Manage display, Choose relevant fields
SECTION 6:
CUSTOM CODE -
PROXIMITY SEARCH
Example of custom code
Display location
search results
Location data in search
• Takes the
coordinates
of the search,
and returns
to the query.
Demo: Location results
• Use Display Suite to display a location on a
Map. 

• Which modules work best

• Tips about handl...
Exercise 6: Display
location results
• Requires: The Display Suite modules, GMap,
GMap Location, Geocoder.
SECTION 7:
ENHANCEMENTS
If time allows!
Indexing files such as
PDF or DOCX
Search file attachments
Search files
• Document search!
• Server requirements
Demo: Attachment search
• Assumes you’re using Acquia’s search
service 

• Enable Apache Solr search attachments
ANY QUESTIONS?
Feedback please!
http://acquia.com/training-feedback
Upcoming SlideShare
Loading in …5
×

Apache Solr Search Course Drupal 7 Acquia

5,219 views

Published on

Apache Solr Search Course Drupal 7 Acquia

Published in: Technology
  • Be the first to comment

Apache Solr Search Course Drupal 7 Acquia

  1. 1. INTRO TO SEARCH IN DRUPAL 7 Create an optimal search experience
  2. 2. Welcome!
  3. 3. SECTION 1: WHAT ARE WE SEARCHING FOR? Introduction
  4. 4. We need search! The problem
  5. 5. Why do you need search? • Commerce - increase sales? • Large amounts of data? • Connecting people to information? ! • Share some examples!
  6. 6. Our sample travel site • Administration > Structure > Content types • Administration > Reports > Field list
  7. 7. Core search - what’s in the box? We need a search page!
  8. 8. Drupal 7 core search • Interval defines how often updated content is being processed and sent to the index. Cron.php Indexing process
  9. 9. Core search indexing • HTML Tag Scores! • <H1> scored at 25 ! • <H2> scored at 18! • Headings have higher scores than content.! • Accent Removal! • Montréal => Montreal! • Stemming! • skips, skipping also means “skip”
  10. 10. Core search limitations • SQL Not optimized for full text search! • Limited Operators! • Slow/not scalable! • Stemming happens on PHP side, not optimized! • Dead ends
  11. 11. Demo: Core search • Load up Drupal core search • Confusing UI • Advanced search? Users don’t use it. • Confusing UI of Search page • Can’t customize options • Index? • Limitations for fine-tuning
  12. 12. Exercise 1: Core search configuration • Load up Drupal core search • Confusing UI • Advanced search? Users don’t use it. • Confusing UI of Search page • Can’t customize options • Index? • Limitations for fine-tuning
  13. 13. Dead ends.... • A bad landing page, with no suggestions. • “Don’t make me think”.
  14. 14. What are alternatives?
  15. 15. Alternatives to core search • Full services:! • Google’s Custom Search ! • Google Search Appliance! ! • Indexing software:! • Fuzzy Search! • Elasticsearch! • Apache Solr
  16. 16. Apache Solr • Based on Lucene! • Written in Java; uses container such as Tomcat or Jetty! • Mathematical Indexing! • Replication / Solr Cloud! • Multiple indexes (Multicore)
  17. 17. Apache Solr • Separate Server! • Indexes your site! • Widely used and tested GET (POST) Search *SQL Web ServerPOST index Solr
  18. 18. Integrating Apache Solr and Drupal
  19. 19. Integrate Solr w/ Drupal • Search API • Apache Solr Search Integration
  20. 20. Customizing Solr • Improve the Index • What Solr is storing • How Solr indexes information • Improve the Query • What is being requested from Solr • Improve the Results • What is displayed to the user, and how they navigate the search experience http://2012.pnwdrupalsummit.org/sessions/customizing-apache-solr-search-experience
  21. 21. SECTION 2: CONFIGURE SOLR SEARCH IN DRUPAL Getting set up
  22. 22. What comes with Solr?
  23. 23. Comparisons Core index config Solr index config
  24. 24. Available with Solr Spell checking Bias settings Suggestions
  25. 25. “More like this” • Example from NIH.gov: 
 Instead of using Entity reference fields. • You can configure multiple suggestion blocks for specific content types or site sections.
  26. 26. Sorting options • A block to allow users to alter sort.
  27. 27. Demo: What comes with Solr? • Enable the modules. • Index the site. What is indexed? • Spelling correction offered out of the box, difference with core search. • Re-index, when does “cron” run? • More like this block, place and configure. • Search page configuration under Pages/ blocks.
  28. 28. Exercise 2: Configure Solr search • A. Ensure search is installed and enabled • B. Index site • C. Review default results • D. Configure your search page • E. Place a “more like this” block on your site.
  29. 29. SECTION 3: HOW TO IMPROVE SEARCH Boosting relevant results
  30. 30. Ways to optimize search
  31. 31. Optmization options • Phrases • Search for sentences, phrases • Optimize search for specific use cases • More recent content, is it more relevant? • Content with comments, are they more useful? • Body content, use of H2 and H3? • Synonyms • synonyms.txt -
  32. 32. Demo: Optimize results • Bias settings • When changes take effect • Before and after examples
  33. 33. Exercise 3: Optimize your search results A.Test search before changes B.Improve the result biases C.Testing the changes; how to check the Index D.Improve term proximity results E.Improve bias based on fields and terms
  34. 34. SECTION 4: FACETS AND WIDGETS Filtering and displaying results
  35. 35. Facets: What users want
  36. 36. Facets provide useful filters Shows what it’s filtered on Bravo.com, Drupal site
  37. 37. Select content .net magazine, Drupal site
  38. 38. Offer facets people need Do clients sort by name? Use facets and sorting which influence decisions. ! Material Color, etc made.com, not a drupal site
  39. 39. Tips to define facets • Listen to users • Analyze query logs to define facets. • Use popular words to label facets. • Check competitors and across your industry. • Choose important facets • On which facets do people make decisions? • Which features influence a purchase? • Plan content types for searching • Depends on your content model, taxonomy, fields! http://uxdesign.smashingmagazine.com/2009/12/08/principles-of-effective-e-commerce-search/
  40. 40. How are our users searching? • What facets would you enable on this site?
  41. 41. Facets API in Drupal
  42. 42. About Facets • For each facet you configure: • A display widget • A corresponding query type. • A block to place, some examples:
  43. 43. Example display widgets With Facet API Additional modules Links Tag cloud 
 drupal.org/project/facetapi_tagcloud Links with checkboxes Slider 
 drupal.org/project/facetapi_slider
  44. 44. Demo: Configuring facets • Enable the module. • Review options for configuring facets for different displays. • Display widgets, relate to specific queries.
  45. 45. Exercise 4: Configure a facet slider • A. Configure the facet options • B. Place the population facet block • C. Test the search • D. Enable the slider for display • E. Test the search again
  46. 46. SECTION 5: HOW TO IMPROVE USER EXPERIENCE
  47. 47. The user experience
  48. 48. Established standards • Users expect the search form to be... where? • Queries • Should be easy to refine • Incremental construction • Results • Display the query • Easy to read key information http://uxdesign.smashingmagazine.com/2009/12/08/principles-of-effective-e-commerce-search/
  49. 49. Beyond the defaults • Limitations: • Default results don’t show relevant data specific to your site: dates, numerical data, location maps. • Better: • Landing page revealing the content • Better search bar with suggestions! • Key information in results with custom displays. • Paths which are easy to share and navigate.
  50. 50. Options to improve experience
  51. 51. Making improvements
  52. 52. Configure search page
  53. 53. Search page options • How many results? • Enable spell check? • Show search box? • Enabled Facets?
  54. 54. Facet block placement • Double check your facet block configuration. • Where to display? Search box in header?
  55. 55. Demo: Apache Solr Autocomplete • Enable Apache Solr Auto Complete. • Uses stemming so verb forms are picked up as well. • Becoming standard, what users want.
  56. 56. Demo: Rich snippets • Replicates Google’s results; Needs RDF! Tip: If you install this during demo, please ensure to disable this for next exercise
  57. 57. Demo: Search page configuration • Where you configure Pages/blocks • Demo how to change options
  58. 58. Next: Manage display • Control the display for “Search results” • Limited options; only fields
  59. 59. Display Suite for Search results
  60. 60. Display Suite! • Display Suite + Display Suite Search ! • (and Display Suite UI)! • Custom layout! • Select which fields to display! • Multiple columns, headers and footers.
  61. 61. Example Header Left Footer Right
  62. 62. Display suite • Access items which aren’t “fields”
  63. 63. View modes • Add “view modes” for specific control
  64. 64. Display Suite regions • Variety of layouts
  65. 65. Arrange fields in regions
  66. 66. Demo: Display Suite • Enable Display Suite, Display Suite Search, Display Suite UI • Modify display and change layout for “Search result” • Show what “Search index” provides.
  67. 67. Exercise 5: Improve display with Display Suite • Manage display, Choose relevant fields
  68. 68. SECTION 6: CUSTOM CODE - PROXIMITY SEARCH Example of custom code
  69. 69. Display location search results
  70. 70. Location data in search • Takes the coordinates of the search, and returns to the query.
  71. 71. Demo: Location results • Use Display Suite to display a location on a Map. • Which modules work best • Tips about handling Location data ! • A custom code example- using location as a factor in search. • Search training Location module • Location Search module
  72. 72. Exercise 6: Display location results • Requires: The Display Suite modules, GMap, GMap Location, Geocoder.
  73. 73. SECTION 7: ENHANCEMENTS If time allows!
  74. 74. Indexing files such as PDF or DOCX Search file attachments
  75. 75. Search files • Document search! • Server requirements
  76. 76. Demo: Attachment search • Assumes you’re using Acquia’s search service • Enable Apache Solr search attachments
  77. 77. ANY QUESTIONS?
  78. 78. Feedback please! http://acquia.com/training-feedback

×