refs https://github.com/TryGhost/Team/issues/1665
- When requesting 'all' resource the search could experience significant performance degradation and would be unresponsive when there are large amounts of posts/tags/authors on the site
- The limit of 10 000 records was chosen as a stopgap solution for experiments in live environment. Once we verify this limit is not causing much trouble, we could increase it if neede
refs https://github.com/TryGhost/Team/issues/1665
- elasticlunr in an abandoned package with quite a lot of security vulnerabilities. it also has worse performance memory/processing wise comparing to flexsearch (benchmark: https://nextapps-de.github.io/flexsearch/bench/)
- fusejs was another option that was consideres. it was not chosed due to it's poor performance.
refs https://github.com/TryGhost/Team/issues/1665
- It is not striclty necessary for the tagsIndex declaration to be in the constructor, but it gives a very clear indication of which variables are a part of the class.
refs https://github.com/TryGhost/Team/issues/1665
- This is a premature optimization that's causing loads of roadblocks while everyone is cracking on the feature (the data format changes, etc.)
- Once we are set on the format and need a performance boost we should design a suitable caching mechanism (the current one does not take resource updates into account, so can cause stale content)
refs https://github.com/TryGhost/Team/issues/1665
- The search index should be initialized regardless, even if there are no items to put into it the index should be an empty one.
refs https://github.com/TryGhost/Team/issues/1665
- The search results will be handling authors and tags searches as a next step - this change is a groundwork before making this move.
refs https://github.com/TryGhost/Team/issues/1665
- The npm package for elasticlunr does not contain the latest changes (no way to include document properties in search results). This hack adds document properties manually.
- Long term we should think about either helping the maintainer with releases of the library or weight out alternatives like fuse.js (https://fusejs.io)
refs https://github.com/TryGhost/Team/issues/1665
- The class syntax allows to use constructor DI pattern that helps with unit testing and abstracting away the dependencies
- It wasn't possible to test the internals without having access to the localStorage in tests (you couls access it but that's kind of leaky for tests to know what mechanism is used in the module intenally)