Feb 13 2012
Feb 13

Goal: Improve User Interface for our 10,000+ list of electronic resources.

Solution: When working with long lists  a good UI makes all the difference. In our electronic resources catalog the Views Autocomplete Filter module allows patrons to filter through thousands of titles in a few clicks. Views Autocomplete Filter works in much the same way as Better Exposed Filters (and I wish there were some way to have both filters in the same view – if anyone reads this and has a thought on that it’d be greatly appreciated…). For the videophiles here’s the two minute review

Views Autocomplete Filter



Oddities: The only problem was we got a stinking HTTP 0 error if the patron tried to apply the exposed filter before the site came up with a suggestion.  http://drupal.org/node/627834#comment-2398782 is a pretty straightforward workaround to log errors to a log instead of to the user’s screen…we don’t really care, in our case final fix looks like this


commented line 284 of webroot/misc/autocomplete.js
error: function (xmlhttp) {
//alert(Drupal.ahahError(xmlhttp, db.uri));

and with that we achieved greater happiness, and all was better in the realm.

For Drupal 7 Autocomplete Deluxe looks pretty nice as well…

Jan 25 2012
Jan 25

It’s been a while since we looked at Apachesolr Drupal integration.  In large part that is because it “just works.”

It's solr, in a view, with exposed filters, facets, and it brews tea!

With the recent release of new code on Apachesolr Views (Big ups to dstuart, Ravi.J and ygerasimov for the recent contributions… everything seems to be aces) it’s time to revisit the subject.

If you have struggled with theming the search-result.tpl.php file and really don’t want to learn any more about getting great faceted search results you are totlally in luck!  Note to all: we’re using views 3.x-dev, apachesolr 3.x-dev, and apachesolr_views 3.x-dev.

For those of you who are video inclined here’s a ~4 minute screencast

For the rest of you Robert Douglass called it over two years ago in his “views 3 + apachesolr + acquia drupal = the future of search” post and for the most part that’s the deal – if you want to see more screen shots go there.

We’re also using ApacheSolr Custom Fields and the Batch Indexing module (thanks anarchivist)  (as mentioned previously).  Note that at this time the custom field module requires this fix to run… but still a handy module.

Learn to not code with the help of nice mods!

Custom Fields is well worth the minor effort in that it is another piece of the no-coding puzzle.  We also enjoyed having views php (a bit of coding is ok – we used it to set up displays per content type in the view)

Also using better exposed filters again to make the UI for the exposed filter better… gotta love naming conventions!

In any case the working view took about 10-15 minutes to produce, with ~5 minutes spent making tea.

Attached below is our working stack in a zip file

if anyone wants to download the entire package that we’re using go ahead, there are a few known issues including taxonomy facets that still need to be patched in this release, however for many use cases it is good to go
 Solr Stack – Views + Apachesolr + Apachesolr Views + Batch Reindex + Custom Fields

Jan 24 2012
Jan 24

Exposing filters in a view is a great way to add interactivity to lists. Out of the box Drupal Views lets you use CCK select lists as an end user visible filter.  The downside is that the select list is a clunky user interface.  To select multiple options you have to hold down the control button while mousing around – not so bad with a short list, but rapidly unmanageable with a longer list.

To solve this user experience conundrum mikeker provided the new and improved exposed filters… aptly called “better exposed filters“  – one thing I like about drupal is that the naming conventions tend to be fairly obvious.

Here’s a brief ~2 minute walkthrough of setting it up

Before Better Exposed Filters

After Better Exposed Filters

Note: you do of course have to expose the filter in views before being able to use the “better” exposed filter…

The tools are available in a new block within your view

Initially after turning the module on I expected to see the new options available from within the filter section of the view, however the module creates a new menu region within views… afterwards style the output as you see fit with css – such that happiness may reign.  any questions or comments welcome

About Drupal Sun

Drupal Sun is an Evolving Web project. It allows you to:

  • Do full-text search on all the articles in Drupal Planet (thanks to Apache Solr)
  • Facet based on tags, author, or feed
  • Flip through articles quickly (with j/k or arrow keys) to find what you're interested in
  • View the entire article text inline, or in the context of the site where it was created

See the blog post at Evolving Web

Evolving Web