How to recover from Solr deleted index files?

前端 未结 4 1204
长发绾君心
长发绾君心 2021-01-07 22:09

When I delete solr\'s index files on disk, (found in /solr/data/index and solr/data/spellchecker), solr throws an exception whenever I try to make

相关标签:
4条回答
  • 2021-01-07 22:48

    Exception FileNotFoundException signals that an attempt to open the file denoted by a specified pathname has failed. So either your index is invalid or corrupted.

    NIOFSDirectory class is used for reading and writing index files. The directory is created at the named location if it does not yet exist.

    So you should probably:

    1. Delete the index directory or restore data from backups.
    2. Restart the server (or at least the reload the config).
    0 讨论(0)
  • 2021-01-07 22:50

    Solr will throw that exception at startup if the index directory exists but is empty. However if you delete the directory, Solr will create it and the empty segments files at startup.

    0 讨论(0)
  • 2021-01-07 22:50

    The problem may lie with the segments file if you delete the index . the files are physically deleted but are present in the ram or cache of the solr . Avoid deleting files directly from solr index files physically . use delete query to delete the index , doing this would alter the segments of the index and you will not have to restart the solr

    regards

    Rajat

    0 讨论(0)
  • 2021-01-07 22:52

    If you are using sunspot solr on rails, sunspot can reindex all the data from the database into solr. However, solr standalone would not know where to pull the data to reindex. You would need a backup of the data.

    0 讨论(0)
提交回复
热议问题