Closed eklem closed 3 years ago
Hi Espen- thanks for pointing this out- the examples folder is out of date and should be removed (or updated). The read
function has been removed, and normally you would use QUERY
instead
A complete quick start would look something like this:
const si = require('search-index')
const run = async () => {
// initialize an index
const { PUT, QUERY } = await si()
// add documents to the index
await PUT([{
_id: '1',
text: 'the first document'
}, {
_id: '2',
text: 'the second document'
}])
// read documents from the index, and send to console.log
const results = await QUERY('document').then(console.log)
}
run()
Thanks, working! I think the examples are a fantastic resource, so I can see if I get them working, keeping the intention intact.
Also saw that include
is now INCLUDE
and exclude
is now EXCLUDE
in the last NOT-type query.
I'm not so good at async stuff, so wondering if I could get a little help. First I was trying the quick start example, but didn't get that running. Then I tried examples/SEARCH.js
error message: