# Optimizing search index with paths instead of urls

**URL:** https://zola.discourse.group/t/optimizing-search-index-with-paths-instead-of-urls/2930
**Category:** Feature requests
**Created:** [April 8, 2026, 4:21pm UTC](https://zola.discourse.group/t/optimizing-search-index-with-paths-instead-of-urls/2930 "2026-04-08T16:21:42Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![webcoyote](https://yyz2.discourse-cdn.com/free1/user_avatar/zola.discourse.group/webcoyote/32/1602_2.png) [@webcoyote](https://zola.discourse.group/u/webcoyote)
#### Post date: [April 8, 2026, 4:21pm UTC](https://zola.discourse.group/t/optimizing-search-index-with-paths-instead-of-urls/2930/1 "2026-04-08T16:21:42Z")

</div>

Zola is great; I’m using it for my blog (Code of Honor) and I love how fast it builds/runs compared to all the javascript builders.

I added search to my site, and discovered it does not work running locally, only in production, because the search indices (elasticlunr/fuse) use the full url instead of the path. That causes the local build to use the production index.

By removing the domain component my index works on local & production, and reduces size by 16% (1.8MB → 1.5MB).

Right now I’m using `sed` to post-process the index after it’s created, but it’s an easy fix to change zola ( [search: use relative paths when building search indexes by webcoyote · Pull Request #1 · webcoyote/zola · GitHub](https://github.com/webcoyote/zola/pull/1/changes) ) to generate the same results.

This comment ( [Search Improvement - #24 by keats](https://zola.discourse.group/t/search-improvement/344/24) ) suggests there might be issues. I’ve tested this for my site with both elasticlunr and fuse and they both function correctly.

(Incidentally I’m also zipping my index to `search_index.en.json.gzz`, which brings it down to 183K).

Glad to send my PR if desired.
