Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Stable JSON output after replacing HashMaps with BTreeMaps #15

Merged
merged 1 commit into from
May 14, 2018

Conversation

tcr
Copy link
Contributor

@tcr tcr commented May 13, 2018

mdBook is a downstream consumer of elasticlunr-rs, and I submitted a patch there to enforce stable ordering of keys when it converts the search index to JSON.

Another way to accomplish this is to force sorted maps in elasticlunr itself by using BTreeSet. (Either solution fixes the downstream issue.) I know that issue #3 says that a trie would be a better replacement though, so no worries if this is too excessive a change just for stable key ordering.

@mattico
Copy link
Owner

mattico commented May 14, 2018

It'll probably be a while before I switch over to a real trie, since it'll be a pain to write the manual serialization code. This seems like a good idea for now.

@mattico mattico merged commit de98a38 into mattico:master May 14, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants