So many of your fields look like tags or facets, e.g. sector
or market
, so you full text search might not be the best way to search on these.
Instead if you had full text search on the tags themselves, e.g. full text search on all the possible values for sector
or market
, and then, with the resuts of this tag lookup, go and find companies that have this tag. The facted search, lookup by tags (or groups of tags) isn't really lunr's forte, but you could certainly use it for full text search of the tags.
var idx = lunr(function () {
this.ref('id')
this.field('name')
})