olivernn / lunr.js

A bit like Solr, but much smaller and not as bright
http://lunrjs.com
MIT License
8.94k stars 548 forks source link

Prebuilt Index question/concern #489

Open cfjedimaster opened 3 years ago

cfjedimaster commented 3 years ago

I've used Lunr a few times and I'm now taking a look at prebuilt indexes. It works as advertised, but I've noticed a problem. If I want to display results and use the ref property, then I need to load the data the originally created the index as well. So previously my logic was:

load in data create an index etc

With a prebuilt index, I thought I'd just need:

load in index create from what I just loaded etc

But it looks like I'll need to do:

load in data load in index create from what I just loaded

So two network calls instead of one - but in theory, still better as I'm not creating the index on the fly.

Is this understanding correctly?