By mistake i delete the table post_search_data in discourse data, How this table can be regenerated ? As this table depend upon the table posts, there might be a way to regenrate it, please help.
AI-generated summary
A user, veer, accidentally deleted the post_search_data table in their Discourse database and sought help to regenerate it. tgxworld suggested restoring from a backup, but since veer didn’t have one, sam recommended running the rake search:reindex task to recreate the index. veer successfully ran the command and thanked sam for the help.
tgxworld also provided an alternative solution to recreate the entire database using rake db:drop db:create db:migrate, but warned that this would reset the database. veer was concerned about losing important data and fefrei and tgxworld advised against using this method if there was data that couldn’t be recreated.
Do you have a backup?
not have backup, is there not a way to populate the tsvector directly with PSQL and the raw also, using ssh ?
There is a rake tast that regenerates the index
./launcher enter app
rake search:reindex
I would strongly recommend restoring from a backup though if you have started mucking around with tables. Who knows what else happened.
thank you very much sir, next time i keep a backup, before playing with tables.
sorry forgot to mention, i am on development enviorment not docker. what should i run in ruby ?
should i run this ? but how ? what command exact command ?
discourse/app/services/search_indexer.rb
i am running
rake search:reindex lets see
thanks it saved my big time.
If you’ve nothing important in development mode, you can run the following commands to recreate the entire db
rake db:drop db:create db:migrate
SIR, I am import DB in development to use it in production, if i use it, it will reset the db ???
Yes, it will reset the DB. But doing this and re-running the import may be the sanest way forward if you messed with the database…
Yea don’t run it if you have any important data that you can’t recreate in development mode.
Thanks, it helped a lot.