Open abalter opened 3 years ago
Hi
just collect documents by ref
(that's equal id
attribute):
const result = idx.search(query)
// result as an array of objects (documents)
console.log( result.map(item =>
documents.find(post => item.ref === post.id)
)
Here is some code I'm trying out:
When I run it, the console output is:
I have retrieved the id's for the matching records, but suppose I want the sizes? Shouldn't I be able to use the index to get the matching records themselves?
https://replit.com/@abalter/lunr-search-1