Better Search (Again!)
Posted on March 24, 2017 by Lev
A while ago we moved from using our default database search functionality to using a dedicated search server for ingredient searches. It's much faster, consistent between autocomplete and actual search results, matches partial searches, more powerful with filtering, and just more robust.
However, our initial implementation fell short in a couple areas, which we've worked to improve. You can read all about it below!
First, it didn't stem words. Meaning that if an ingredient was stored as "raspberries" and you searched "raspberry", you wouldn't get that "raspberries" ingredient in your result. So we're now using a stemming library to make sure the root word is used for the search rather than the specific version of the word (plural, past tense, etc.).
This gives more reliable search results and includes better options that otherwise might have been missed if using the exact search term and ingredient name.
Fuzziness and Typos
The other thing that we now account for is typos and small differences in words. Now, if you mistype something (or even if you don't), it'll compare the search term to similar results (within reason) to see if maybe you meant something else. For example, "rasberry" will still match "raspberry".
For the most part this isn't an issue. But sometimes you'll be stumped why nothing shows up for a certain search and you were just off by a letter or two. Now that shouldn't be an issue. It's not magic, but it hopefully fixes little mistakes for you, which is kind of what you come to expect with searching on the internet these days!
We were a bit hesitant with switching to the new search method a year ago, and it left a few things to be desired initially. But now we're very happy with the results and how powerful and fast it is, and it should make our nutrition facts generator even better.
Have your own experience or comments on the search results? Let us know in the comments below, chat, or email us.
Engineering Recipal Features
Learn why hundreds of food entrepreneurs already use ReciPal to manage their recipes, costs, and create nutrition labels.
Sign Up Absolutely Free
Just want lessons on growing a food business?
~1 email per month. Your information will not be shared.