fergiemcdowall / search-index

A persistent, network resilient, full text search library for the browser and Node.js
MIT License
1.38k stars 149 forks source link

Using search-index with redisdown gives error #591

Closed CihanErenler closed 1 year ago

CihanErenler commented 1 year ago

Hello, I've been trying to use search-index with redisdown, and I took the code block you provided on the search-index web page as an example. Which is this one:

const memdown = require('memdown')
const si = require('search-index')

const memdownIndex = await si({
  db: memdown,
  name: indexName
})

But when I pass the redisdown as the example code above it gives this error on console

C:\Users\laga\projects\search-index-test\node_modules\redisdown\scriptsloader.js:58
  redis.send_command('script', ['exists'].concat(shas), function(err, reply) {
        ^

TypeError: redis.send_command is not a function
    at preload (C:\Users\laga\projects\search-index-test\node_modules\redisdown\scriptsloader.js:58:9)    
    at C:\Users\laga\projects\search-index-test\node_modules\redisdown\scriptsloader.js:54:7
    at processOne (C:\Users\laga\projects\search-index-test\node_modules\redisdown\scriptsloader.js:25:16)
    at C:\Users\laga\projects\search-index-test\node_modules\redisdown\scriptsloader.js:46:5
    at FSReqCallback.readFileAfterClose [as oncomplete] (node:internal/fs/read_file_context:68:3)

Do you have any example code for initializing search-index with redisdown?

fergiemcdowall commented 1 year ago

Thats a shame. The whole levelup/leveldown ecosystem has undergone a upgrade recently, with the unfortunate consequence that many of the old *downs are no longer usable.

See the level FAQ for more info. I think it would be great if the old *downs could be brought back to life.

fergiemcdowall commented 1 year ago

In the meantime I will update the search-index docs here accordingly

fergiemcdowall commented 1 year ago

see: https://github.com/Level/community/issues/116

fergiemcdowall commented 1 year ago

Closing since the level ecosystem has moved from abstract-leveldown to abstract-level. I agree that a redis abstract-leveldown would be great to have.