[Note: I am writing this blog post after Ayende’s. I was planning to do just one post after I had got some help from him on improving my RavenSuggest code. This post is my initial thoughts I wasn’t going to post.]
Its come to the point in the client’s application where letting the user choose an item from a HTML select control is not practical. The basic idea is the client can select an existing item from the database to include, this becomes painful when you have >200 items to choose from!
This also has a few usability issues, mainly, the user might not know the item they are exactly looking for, may mistype the name or my ordering of items might not make sense to them.
1. Don’t take the user out of context. E.g. they shouldn’t have to move page.
2. Users might not know the exact item’s name. E.g. they might know “Diamond” of the item “BlueFooDiamond Ltd”. Help them.
3. Items can have weird naming. E.g. “Kart” or “Cart” could both be used for the same item’s name.
4. Be friendly. The users aren’t technical and it should do its best behind the scenes to get the best results.
5. Be fast. Users don’t like waiting.
What if I could do something clever like those smart folks over at Google. RavenDB comes with Lucene and is pretty good at doing searches.
Below is a screenshot of my first attempt using RavenDB and jQuery UI’s autocomplete plugin.
This is a good starting point. It works but I want to improve it.
It should use existing data the user has entered to help narrow the search down and make it more relevant.
This feels bad
I am not sure “*term*” is really the best approach. I can’t see anything in the API or RavenDB documentation that hints at a better way. Perhaps I better Tweet Ayende and see if he can help me out. I uploaded the demo code to Github, to a project called RavenSuggest.
— Phil Jones (@philjones88) July 7, 2012