olivernn/lunr.js — pull request #31 by olivernn (2013-05-17 09:48:38+00:00)
Title: Fix bug when indexing a document with empty fields

Updates to #28 which fixes #27.

This makes sure that documents with an empty field do not end up getting a `NaN` score when searching.

If a field has no tokens it should not contribute to the tf for that token, before it was and 0 / 0 leads to a `NaN`.