instaclustr / cassandra-lucene-index

Lucene based secondary indexes for Cassandra
Apache License 2.0
33 stars 19 forks source link

How to add a new column to the Lucene index? #22

Open maylingge opened 7 months ago

maylingge commented 7 months ago

Hi experts, It's just a question. Might be a silly one. I am not sure how to update a Lucene index. It seems I need to drop the index and create it again when I need to add a new column to the index.

For example, if I have index define as following: CREATE CUSTOM INDEX tweets_index ON tweets () USING 'com.stratio.cassandra.lucene.Index' WITH OPTIONS = { 'refresh_seconds': '1', 'schema': '{ fields: { id: {type: "integer"}, user: {type: "string"},

  }

}' };

And now I have another column to add to the index as following: body: {type: "text", analyzer: "english"}

Should I drop the old index and create a new one as folowing: CREATE CUSTOM INDEX tweets_index ON tweets () USING 'com.stratio.cassandra.lucene.Index' WITH OPTIONS = { 'refresh_seconds': '1', 'schema': '{ fields: { id: {type: "integer"}, user: {type: "string"}, body: {type: "text", analyzer: "english"}, } }' };

Thanks!