Auto-completing Drupal with Redis

I’ve been working on some functions for a forthcoming site at Janet and have been looking at the user functionality in some of our forms. In a reversal of roles, I’ve been trying to find ways of making it easier for users to complete the forms for various products and services which has taken me down some interesting avenues.

One of them is the idea of autocomplete. Nothing new there but something that can be easily overlooked when looking at the data instead. User Experience (UX) isn’t the only reason I’ve been looking at this. I’m also trying to find ways of keeping some of our data cleaner than it is and limiting options to a validated set currently seems to be the best way of doing this. To that end, as I’m still in the early stages of learning Drupal, i searched the Drupal forums and came across this comment (http://drupal.org/node/1117562#comment-4452968) which has really helped me understand this. I’ve only implemented a cursory version of this code at the moment, throwing some rough values into the array to return, but the results appear to show fruit.

My intention is to back this onto a Redis store which will hold the cached data so that the site is not putting undue strain onto the main database and that the data store can be shared with other applications on the site. I’ve got the Rediska library which I’m currently using but it has far more functions in it than I’ll ever need so I might roll my own pure PHP stripped down library. I’ll see what time I have.

One Comment

Leave a Reply

Your email is never shared.Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.