An improved search engine

You asked for it, and here it is: better search. The previous search was really a filter: a simple substring scan. It was good for a start, but you asked for something better, which could handle multiple words.

PartsBox now has a fuzzy-matching search engine that is designed to match electronic components well. It tolerates a certain amount of misspellings and still gets the right results. And most importantly, it runs right in the browser, and also happens to be faster than the old search for non-trivial databases.

Fuzzy-matching is really great. For example, searching for "61a20dwp" will bring up the TPA6120A2DWP which you really wanted, and typing "mcp78381" will show the MCP73832T-2ACI/OT that you have in stock.

The new component search engine has also been written in such a way that it can run both in the browser and on the server. This is great, because it provides scalability: for companies with large part databases it won't be a problem to keep the index on the server and run searches there. In fact, tests show no noticeable difference in performance as we switch from client-side searching to sending searches to the server.

The new engine indexes component names, descriptions, footprints and user notes by default. A few hints on usage:

  • In general, just type what you're looking for, and it should Just Work.
  • If you're looking for separate words, type them as separate words, but if you remember the beginning and ending of a component name, type it as a single string.
  • There is no "special syntax", such as phrase quoting, prefixing with a "+", or anything like that.
  • The engine will tolerate a certain number of typos/misspellings, but there are no miracles: you have to get at least part of the name right.

Another important change was introduced to the Storage table. As it turns out, the "Part Count" that used to be displayed there was confusing and not very useful. It was a count of distinct parts that are (or were) stored in a particular storage location. You could think of it as the number of labeled zip-lock bags in that location. The bags could be empty (if you used up all the components), but they would still get counted. This resulted in a significant number of bug reports. The number has been replaced with a "Stock" number, indicating the total stock for that location.

A number of small bugs were squashes, among them linkification: the process of detecting links in your note text and turning them into HTML links. It turns out this is surprisingly difficult to get right. Hopefully I got it right this time.

There were also lots of under-the-hood changes, which should not be user-visible. These either result in better performance, or lay down the foundation for new features which will come in the future.

I hope the new search engine will improve your workflow when working with electronic components!

Later blog posts: Projects (BOM management) (2016-04-20)

PartsBox is an online app that lets you take control of your electronic parts inventory, BOM pricing, and small-scale production. It keeps track of where components are stored, what the current stock levels are, and which components are used in which projects/BOMs.

Blog Index