cmfcmf / docusaurus-search-local

Offline / Local Search for Docusaurus v2. Try it live at:
https://cmfcmf.github.io/OpenWeatherMap-PHP-API/
MIT License
437 stars 67 forks source link

Deterministic indices #138

Open SheetJSDev opened 2 years ago

SheetJSDev commented 2 years ago

Please describe the bug you are seeing

When rebuilding a site that has no content changes, search-index-docs-default-current.json changes.

Ideally the process would generate the same index on each run if neither the content nor the generated pages have changed.

How can we best reproduce the bug?

git clone https://github.com/SheetJS/docs.sheetjs.com
cd docs.sheetjs.com
make init
make build
git status ## verify that docs/search-index-docs-default-current.json has changed
git add docs/search-index-docs-default-current.json
make build
git status ## observe that docs/search-index-docs-default-current.json has changed again

Which version of Docusaurus and @cmfcmf/docusaurus-search-local are you using?

├─┬ @cmfcmf/docusaurus-search-local@0.11.0
│ └── @docusaurus/core@2.0.1 deduped
├── @docusaurus/core@2.0.1
├─┬ @docusaurus/plugin-client-redirects@2.0.1
│ └── @docusaurus/core@2.0.1 deduped
├─┬ @docusaurus/preset-classic@2.0.1
│ ├── @docusaurus/core@2.0.1 deduped
│ ├─┬ @docusaurus/plugin-content-blog@2.0.1
│ │ └── @docusaurus/core@2.0.1 deduped
│ ├─┬ @docusaurus/plugin-content-docs@2.0.1
│ │ └── @docusaurus/core@2.0.1 deduped
│ ├─┬ @docusaurus/plugin-content-pages@2.0.1
│ │ └── @docusaurus/core@2.0.1 deduped
│ ├─┬ @docusaurus/plugin-debug@2.0.1
│ │ └── @docusaurus/core@2.0.1 deduped
│ ├─┬ @docusaurus/plugin-google-analytics@2.0.1
│ │ └── @docusaurus/core@2.0.1 deduped
│ ├─┬ @docusaurus/plugin-google-gtag@2.0.1
│ │ └── @docusaurus/core@2.0.1 deduped
│ ├─┬ @docusaurus/plugin-sitemap@2.0.1
│ │ └── @docusaurus/core@2.0.1 deduped
│ ├─┬ @docusaurus/theme-classic@2.0.1
│ │ └── @docusaurus/core@2.0.1 deduped
│ └─┬ @docusaurus/theme-search-algolia@2.0.1
│   └── @docusaurus/core@2.0.1 deduped
└─┬ @docusaurus/theme-live-codeblock@2.0.1
  └── @docusaurus/core@2.0.1 deduped

Which Node.js version are you using?

v18.8.0

Which theme are you using?

Yes, I am using @docusaurus/theme-classic

How does your plugin config look like?

No config:

    require.resolve("@cmfcmf/docusaurus-search-local"),

Additional context

Awesome work!