bleroy / lunr-core

A port of LUNR.js to .NET Core
MIT License
558 stars 24 forks source link

[BUG] ambiguous JSON serialization options leave possibility for data loss #20

Open danielcrenna opened 3 years ago

danielcrenna commented 3 years ago

To Reproduce ToJson and SaveToJsonStream allow passing optional JsonSerializerSettings. LoadFromJson and LoadFromJsonStream do not allow passing an optional JsonSerializerSettings.

Expected behavior In the above scenario it's possible to serialize an index in a way that is not reversible when loading the same index later. In addition there are no unit tests for ToJson with the accompanying options, so it's unclear whether the correct intention is not to have options, or to have options for both sets of methods.

It seems that it might be easier to remove the options to ensure the index is compliant with lunr-js, but I'm not sure, and so haven't added a pull request.