Search code examples
redisredis-cli

Altering a redis index to remove stopwords


I'm using RediSearch and I would like to remove all the stop words, I can read in the documentation that it says to set the STOPWORDS to 0 using the FT.CREATE command, however, I have an already created index I would like to modify to remove the stopwords, how can I do that?


Solution

  • It seems the index has to be dropped and re-created with the STOPWORDS set to 0. I was using redis-om (for node) and I could turn off stopwords in the schema definition.

    import { Schema } from 'redis-om';
    
    const something = new Schema({
        // ...options
    }, {
      useStopWords: 'OFF'
    })
    

    The above example disables the stop words for the index, and if it is already created, it will be re-made by the lib itself.

    Thank you.