I know you’ve previously discussed the inability to output custom fields in the RUST generated elasticlunr.js JSON index. I accept custom search fields would be mission creep and Zola needs to stick to what it does best.
But... Would it be possible to specify a trim size for the page data?
For example; At it’s simplest, a
config.toml variable that said
search_truncate = 200 i.e. first 200 hundred characters would be used to build the stem words and be held in the index JSON data, you would simply skip the rest. If the page is
< 200 characters long you just roll with what you’ve got.
You change none of the current implementation other than to lookup a configuration variable which determines if you trim the page length data.
I think one of zola’s USP’s is the search built in. Implementing search for a static website can be a major pain or worse still cost money.
Implementing this basic limitation does a few things:
- It makes search possible for websites with a small number of pages, even when the pages contain a lot of character data/text.
- It gives people, who have 100’s of pages, the flexibility to reduce the file size of the
search_index.en.jsfile to keep it usable before having to look for alternative search engine options.
- Possibility to set
search_truncate = 0which would effectively make the search
- In theory it’s not breaking any of the current implementation, it all works exactly the same way, except the data you generate the search index is trimmed first.
At this point your thinking, omg these guys just don’t get it. It’s impossible or hopefully, this one is doable
I look forward to your views.