You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
var strs = [];
strs.push('Tobi wants four dollars');
strs.push('Tobi only wants $4');
strs.push('Loki is really fat');
strs.push('Loki, Jane, and Tobi are ferrets');
strs.push('Manny is a cat');
strs.push('Luna is a cat');
strs.push('Mustachio is a cat');
const key = 'pets'
redsearch.createSearch(key, {}, (err, search) => {
search.remove("hola")
})
redsearch.createSearch(key, {}, (err, search) => {
if (err) console.log(err)
strs.forEach(function (str, i) { search.index(str, "hola"); });
});
redsearch.createSearch(key, {}, (err, search) => {
search
.query('cat* mus*')
.type('direct')
.end(function (err, ids) {
if (err) throw err;
ids.forEach(function (id) {
console.log(' - %s', id);
});
});
})
Drop this error when the index is not created (the fisrt time):
ReplyError: Index already exists. Drop it first!
at parseError (/srv/test/node_modules/redis-parser/lib/parser.js:193:12)
at parseType (/srv/test/node_modules/redis-parser/lib/parser.js:303:14) {
command: 'FT.CREATE',
args: [ 'pets', 'SCHEMA', 'payload', 'text' ]
}
PROJECT: https://github.com/stockholmux/redredisearch
This code:
Drop this error when the index is not created (the fisrt time):
I found some workaround grouping the callbacks:
The text was updated successfully, but these errors were encountered: