Closed sustained closed 4 years ago
A function can be used to 'extract' a field from a document, this is specified when configuring the index, e.g.
var fooFieldExtractor = function (doc) {
return doc.foo.bar.baz
}
lunr(function () {
this.field("foo", extractor: fooFieldExtractor)
})
You have access to the document in the extractor function so can do whatever you need to get the right value to index.
Fuse.js allows us to do stuff like this:
...which is really nice.
AFAICT from the docs/guide, here I would need to flatten the data, right?
But how would that work with e.g. my labels?
Thank you!