What is contained in search.indexes file?

I created a copy of my scrivener project to send to a collaborator. Then I deleted all the folders that I didn’t want him to see. When I was done I noticed that the file size was much larger than I expected. I took a look in the package and saw a 6 megabyte search.indexes file. Does this file contain data that could be used to reconstruct the text that I deleted?

No - it contains a plain text representation of all the text that currently exists in the project, and is used for searches, both internally by Scrivener and by Spotlight. This way Scrivener doesn’t need to open all of the RTF files from disk just to run a search - that is, the larger project size is a trade-off for faster searches and an easy Spotlight search. (It’s used by other things, too, such as checking whether a binder item has text in it to determine its icon.)

You could delete that file and Scrivener would rebuild it when opened the other end, although your collaborator would need to wait a few minutes while it got rebuilt - best to leave it in unless that extra 6MB is a big deal.

Hope that helps.

All the best,
Keith

Thank you. You answered my answered my question. I was vague about what I meant by reconstruct- I think you took it to mean whether the scrivenings could be reconstructed. What I was worried about is whether the other person would be able to read what I thought I had deleted. The answer to that is yes!
I opened the file everything is in there. This is a huge security risk for anyone attempting to do what I just attempted.

You answered my next question in that it does look like I can delete the file without crippling the project. Are there any other files that I need to delete?

But the search file gets updated, so after you’ve deleted the files and closed the project, the text of those deleted files isn’t in the search.indexes anymore.

Are you sure you emptied the trash in the project? When you delete a file in a Scrivener project, it moves to the project’s trash–it’s still contained in the project! You need to empty the trash to truly delete it for good. (Project>Empty Trash… or right click on the Trash folder in the binder.)

Was the project still open when you checked the package? The search indexes file only gets updated whenever you close the project, for speed purposes. It most certainly doesn’t store all the text that has ever been in the project, but if you delved into the package while the project was still open with the session during which you deleted the files, then the search.indexes file would still be in the state it was in when the project opened. (You wouldn’t want a 6MB file saving during every auto-save, and seeing as it can be reconstructed if it gets lost or corrupted, or if scrivener detects a mismatch between documents in the project and docs mentioned in the search.indexes file, nothing’s lost by not saving it until the window is closed.)

EDIT: I see MM has beaten me to it; yes, make sure you’ve emptied the trash, too.

I had definitely emptied the trash but I do not recall whether I had closed the project.