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.
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.
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.