olivernn / lunr.js

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

Documentation: Issue in example Code for Pre-building Indexes #307

Closed stjosh closed 6 years ago

stjosh commented 6 years ago

Hi, I hope this is the correct place to post an issue on https://lunrjs.com/guides/index_prebuilding.html .

In the sample node script for building an Index, var documents = JSON.parse(buffer.join()) is used to parse STDIN to a JSON array. However, this does not work for large inputs (i.e., in case the buffer has more than one element), because if called without arguments, join() will join the array elements with a comma separator, resulting in invalid JSON. So, correct is: var documents = JSON.parse(buffer.join(''))

Many thanks for correcting this.

olivernn commented 6 years ago

The website is in this repository, please open an issue there, or better yet send a pull request ;)

olivernn commented 6 years ago

The specific page is https://github.com/olivernn/lunr-site/blob/master/source/guides/index_prebuilding.html.md

stjosh commented 6 years ago

Perfect, I was looking for the repo of the site but did not find it - shame on me. :smile: Will open a pull-request!

olivernn commented 6 years ago

No problem, thanks for taking the time to open an issue and provide a fix!

stjosh commented 6 years ago

See olivernn/lunr-site#3