Missing search results

I can’t figure out why certain pages in my project won’t show up in search results. I’ve played with the included/excluded settings and nothing seems to work. For instance, today I was searching for a particular word that I knew I had used recently, but a search couldn’t bring it up. After a long manual search I was able to locate the passage I was looking for, and sure enough searching for the word highlights the text on the page, but it doesn’t produce a page hit on the search results in the binder. Can anyone help here?

It could be that the search index is out of date. Try following the following procedure to reset it:

  1. Close the project window.
  2. Locate the project folder using Windows Explorer.
  3. Navigate into the “Files” folder within the project folder (you’ll find it at the same level as the ‘project.scrivx’ file).
  4. Move the ‘search.indexes’ file to the Recycle Bin.
  5. Reload the project.

It may take a moment to rebuild if there is a lot of text, but most likely you won’t even notice a delay. Try searching again and see if the problematic phrase appears.

If not, you may be encountering a bug with the search engine not fully capturing the project text.

Yes, that seems to have fixed the problem. Thank you so much.

I’m really happy to know how about this solution, but it looks like it’s only a temporary fix. When I opened the project again today I noticed the search was missing results again, and I found that a new ‘search.indexes’ file had been been created. Deleting that new file fixes the problem again, but I’m wondering if there is a more permanent solution available?

We’re working on this. It’s not quite clear why the file is getting out of sync in the first place, so I’m afraid there’s not a permanent solution in that sense. In your case, is the project just accessed on the one computer, or do you happen to use Dropbox or the like to sync it with other machines? Do you work cross-platform with the Mac version at all?

The search.indexes file should always exist in the project; if you remove it, it will get rebuilt, but there’s a bug here where it’s not being completely rebuilt when the project opens. It’s indexing the titles, but it’s not filling out the document contents the way it should. Running a search at this point seems to fully rebuild it, though it may take a couple moments depending on how many text files your project contain. It seems like this is what you did already, but just because there are a few quirks with the process, could you try doing it specifically in this order, without loading or clicking anything else between:

  1. With the project closed, delete the search.indexes file
  2. Open the project
  3. Run a search
  4. Close the project once the search is complete

Then reopen and carry on with your regular work. I’m guessing you already did this, and that at some point later the index starts falling behind, but if you could give it a try and then report back at what point you notice the search missing items (assuming you do), and as much as you can recall about what you’ve done in the project between resetting the file and then (how often you’ve closed and reopened, whether you’ve saved, whether the missing documents were edited in that period), that’d be helpful. Also, just to double-check, you’re running version 1.5.7, yes? (Help > About Scrivener) Was the project created in an earlier version?

Thanks for the reply. I am running the Windows 1.5.7 on a single machine. I did have it set to automatically backup to dropbox on close (via tools> options> backup). Unchecking that option does not seem to change things, however. The project was begun on an earlier version, but I’m not sure which.

When I run through the steps you suggest, the search works for the first search after deleting the search.indexes file (step 3), but after closing and then reopening the project, the search does not work. It doesn’t seem to matter if I save or do any work before closing the project. A file called user.lock is created when the project is opened (in step 2) and that file disappears and is replaced by a new search.indexes file on closing (step 4).