Hello there!
I’m newbie in Zola, and first, many thanks Vincent and other for the cool engine. It’s awesome!
I have a small question about search index building. If you have 1000 pages it’s would be nightmare to get all texts in search file, might zola or lunr have any mechanism to limit search index with titles and descriptions only?
If you really have thousands of pages, it’s probably better to not have your search be done in JS like that anyway as the results are not going to be great when based only on name/description. The JS index might get pretty big as well. The Zola docs site for example is pretty small but the index is already 600kb
Did you update the JavaScript to edit the elasticlunr options? By default it uses the keys title & body, you probably need to set description instead of body.
So, if I delete “body” search index are built with titles only. It’s good. But I need my descriptions too!
I saw mdbook’s code and they build search index with title, body and breadcrumbs. And I don’t understand how they declare a variable breadcrumbs? Do I need to add something to the top of the search lib?
You can add anything you want in the index. I don’t use mdbook so I can’t say what breadcrumbs are in their context but right now, its just that Zola only uses title and body to search.
Oh, I ain’t a developer and have a lack of experience with RUST. So easy, many thanks! it works, i’ve just added &page.meta.description.clone().unwrap_or_default(), and search_index built properly as I want!