Closed sheerun closed 4 years ago
Hi @sheerun !
Yes, it’s possible, just pass the idField
option:
const miniSearch = new MiniSearch({
fields: ['name', 'url'],
idField: 'name'
})
Of course, each document has to have a unique name
in this case.
Hope this helps!
whoops, somehow I missed this in docs, thank you!
In my case each record has only "name" and "url" fields. I'd like name to act as id as it's unique.
Is it possible to configure minisearch so it uses name field and doesn't complain that documents don't have this field?