olivernn / lunr.js

A bit like Solr, but much smaller and not as bright
http://lunrjs.com
MIT License
8.96k stars 548 forks source link

Use prototype free object for `fieldTerms` hash #281

Closed petebacondarwin closed 7 years ago

petebacondarwin commented 7 years ago

Previously terms that collided with standard Object properties we breaking the calculation of frequencies - leading to NaN scores for queries.

Fixes #280

petebacondarwin commented 7 years ago

I didn't mean to modify lunr.js but running make test does so. If you don't want it to be committed I can change that, but perhaps it would be good to add it to gitignore in that case.

olivernn commented 7 years ago

@petebacondarwin in general the build process could do with modernising, but for now, just remove the change to lunr.js and we should be good to go.

petebacondarwin commented 7 years ago

Voila!

olivernn commented 7 years ago

Nice! I've merged this, will generate a release later today. Thanks for taking a look at this, much appreciated!