Search results out of date.

Scrivener version 1.2.5.0.

I have a project in which the search results seem to be drawing from an old index of my files. In other words:

  • I have a document which has the word “cat” in it.
  • I delete the word “cat” from that doc.
  • I run a search for “cat,” and that document pops up in the results, despite the fact that “cat” is no longer anywhere in it (or in its metadata, etc.).

Also:

  • I add the word “cat” to an existing document.
  • I run a search for “cat.”
  • The document containing the newly-added “cat” does not pop up. However, if I search within the document itself, the word “cat” is properly highlighted.
  • Documents that ALREADY contained the word “cat” from before a certain point in time, X, do properly list in search results.

Any idea what could be going on here? I tried various search settings to see if I could re-jigger it, but nothing works.

It seems like search is looking at an old index of my files, and not updating to take changes into account.


ETA: I should note that I did a lot of duplication of documents as I was editing this manuscript. That may be involved? Because this seems to be happening:

  • I have a document, Doc 1, that contains the word “cat.”
  • I duplicate that document and create Doc 2.
  • In Doc 2, I delete the word “cat.”
  • Run a search for “cat,” and both Doc 1 and Doc 2 come up in the results.

ETA #2: I seem to have solved this, but I’m not sure which method worked, and it seems to be a bug anyway.

First, I deleted all the duplicated files I mentioned above.

Then, I went to a document that was creating a false search result (listing as a result for “cat” when it did not contain the word “cat”), changed the text slightly, saved the project, and ran the search again.

After a few minutes, Scrivener seemed to “update” and finally produced correct results.

So it does appear that the text is indexed in some way, and Scrivener needs to periodically update its index? Is there a way to do this manually and for the entire project?

Sorry for the late reply on this one. This should be fixed with the new 1.5.3 update, but if simply upgrading and opening and closing your project does not correct the issue for existing projects, you can force the index file to be rebuilt by doing the following:

  1. Close the project in Scrivener

  2. In Windows Explorer, open the project’s .scriv folder and open the Files folder inside

  3. Delete the search.indexes file

  4. Reopen the project in Scrivener

That should clear this up, but let us know if you’re still running into trouble!