This document discusses creating a user-friendly search UI with Drupal using the Search API and Solr. It covers setting up a search index in Solr, adding fields and filters, configuring facet blocks, and creating Views for search results. Facets allow filtering search results and can be configured as multi-select widgets. Views integrate search into the website and allow contextual filters and pagination. Additional modules like Facet API Tabs and Current Search Blocks can enhance the search experience.
4. UPCOMINGTRAININGS
• Intro to Drupal inToronto - May 5
• Panels inToronto - May 6
• Intro to Drupal in Ottawa - May 21
• Drupal Site Building in Ottawa - May 22-23
• Views in Austin - June 2
• WxT-Drupal Site Building - June 12-13
• Drupal Module Development - June 19-20
http://evolvingweb.ca/training
12. WHAT MAKES SEARCH
USER-FRIENDLY?
• Consistency of filtering options
• Results that reflect your content
• Search integrated into the website experience
• Complexity matches the task
• The search engine actually works
13. WHY USE SOLR?
• Flexibility about what you search
• Create multiple search indexes and interfaces
• Provides search faceting
• Hides search options that don’t give you results
• Better performance
14. SETTING UP SEARCH API
1. Set up your search index
2. Add fields to the index & choose filter options
3. Select and configure the facets (this is the fun part!)
4. MakeViews for your search results
17. FIELDS
• Fulltext fields:
• Choose a ‘weight’
• Searchable using the fulltext search
• String / integer fields:
• Available as facets
• Can be used as sorts
18. ADD MORE FIELDS
Create a property
for the info you
want to index
Add a callback
function to return
the value
30. FACET INTERACTIONS
ANDVS. OR
• OR: adding a facet item expands the search, results can match
any facet item
• AND: adding a facet limits the search results. Results must
match all selected facet items
31. FACET INTERACTIONS
• Example 1: Topics for courses.
• Courses can be assigned many topics. If I choose.
• Choosing a topic should reduce the results (AND)
• Example 2: Instructors for a course:
• Courses can have many instructors, but it’s unlikely to search
based on the fact that two instructors are teaching the same
course.
• Choosing an instructor should expand the results (OR)
36. HOW MANY FACETS?
• You can choose to limit the number of facets or show a fixed
number and include ‘show more’ links
• If you don’t show all the facets, how do you choose which to
show?
• Sort by ‘facet name’ or by ‘number of results’
37. ORDERING FACET ITEMS
• Example:‘Filter by Instructor’
• Sorted by # of courses the
instructor is teaching
• Alternative: sort by alphabetical
order
38. ORDERING FACET BLOCKS
• Most used at the top (e.g. Faculty,Terms)
• Smaller # of choices at the top (e.g. undergrad vs. grad)
43. CREATEVIEWS
• Create aView on the search index (e.g. Coursecal Content)
• Add exposed sorts and filter (for fulltext search)
• Contextual filters for ‘search within a section’
44. ADVANTAGES
• Use views handlers for displaying data
• Use display plugins
• Pagination and contextual filters
• Site builders can do it