Search problems

Scrivener for Mac is giving me some problems in searching within documents. Just now, I had typed the phrase “I am now a pretty fluent” and it occurred to me that I was typing something up for a second time. I went to search for the phrase within the document, and not only with the search not find the earlier iteration; it won’t even (on a search for ‘next’ and then for ‘previous’) find it where I’m staring at it on the page.
I’ve tried the obvious things; yes, it’s set to search ‘all’, not Keywords or something; it’s set to ignore case, to look for ‘exact phrase’, to search ‘excluded documents’ and ‘included documents’, whatever that means. What is the obvious thing I’m not doing?

It could be that you have an extra space in the original. Why don’t you search for a smaller phrase (e.g. “fluent”, or “pretty fluent” or whatever). You may get more hits, but you should find what you want.


Searched for ‘fluent’ - no result.

I also tried copy-and-pasting a phrase into the search bar - no result.

If you want to test Scriv’s Find tool, compile to PDF and then use the Adobe Reader Find tool to see if it’s really in the document.

I suspect you have changed the search parameters in Scriv at some point? The little drop down arrow on the left of the search bar allows you to restrict the search to, say, just the keywords. You want it to read “all” I suspect.
Screen Shot 2014-06-24 at 20.32.18.png

Compiled it for PDF, searched for ‘fluent’; Preview’s search found it on 10 pages.

Drop-down menu was the first thing I tried (see above); it’s set to ‘all’.

This is a newly-installed version of Scrivener; I’ve just changed computer, and decided to instal all software new rather than bring inherited problems with me.

Try resetting the search index. Hold down the Option key on the File menu, and select “Save and Rebuild Search Indexes”. Does it work now?

You had me hoping for a moment there, Io, but no, it didn’t work. (I’ve been looking for a reference on a volume of poetry someone in the biography I’m working on mentions in letters: Light on the Broom. Reading, for entertainment, a witness statement by a particularly heroic spy, I discovered that the writer was the son of his headmaster; went to look for ‘broom’ in the text, and got the usual sad little error-message hoot.
Edit: the project search is working - it restricts results to the single document that contains the word ‘broom’; it’s only the search within the document that won’t work.
Further edit: wait - there is one improvement, I find on scooting up through this long document. Now, the search highlights the word; it just doesn’t bring the focus of the page to it. Is there any way of correcting this?

Oddly, this fault seems suddenly to have fixed itself (completely or to a great extent; I can’t find one reference, but maybe that will reappear too). Maybe the indexing took a while and happened in the background. Thanks for your help, Io!

Even more oddly, it’s unfixed itself. I’m now typing up some essays by a great-aunt who was a Citizen Army woman in 1916. I was searching for the word ‘conscription’ and getting no result other than that sad hoot of an error message on looking forward or back. Then I realised I was staring straight at the word on the page in front of my eyes. Why is this happening!

Incidentally, I don’t know if this is related, but the word count isn’t appearing on the bottom bar.

Initially we were looking at the Project Search feature (in the main toolbar), but now it sounds like you are describing document search (Edit/Find/Find…), as project search does not have any kind of “error message on looking forward or back”. I’m not even sure precisely what that could be, as normal document find wouldn’t produce an error in normal situations. On a Mac, if there isn’t anything to find the computer will just beep at you, and when you wrap the search around from the top or bottom of the document it briefly flashes a little overlay with a curly arrow in it to let you know it’s starting over with the search.

So if you could relay the precise text of this error, it could help me know what you’re dealing with.

Try hitting Cmd-8 on your keyboard, does it come back? If so you were in scriptwriting mode. :slight_smile: Otherwise, if you don’t see any footer bar down there at all, you can toggle that on and off, so maybe it just needs to be turned back on: View/Layout/Show Footer View.

Io, it seemed at first to be both the project search and the document search; now it’s mainly the document search. Weirdly, though, it comes and goes - seems to fix itself, goes again.

For instance, I am now looking at the term ‘sixty hours’, and searching for the same term within the document (I’ll try to attach a screen shot). Neither searching forward nor searching for ‘Previous’ will find this. (It used to be that the search was global - is that a setting?)

It sounds like you’ve been using Document Search when focus had been moved somewhere that isn’t the editor. For example, if I click on a folder in the binder, the folder opens in the editor, but this does not cause focus to move from the binder, which I just moved focus to by clicking on the folder, to the editor. If I hit cmd+F with focus in the binder, search for a word that I can see in the editor, and press either Previous or Next, I get the error sound too. Try moving focus to the editor/split you want to use Document Search in (by e.g. clicking inside it) before you search.

Yes, it sounds to me as though your cursor is somewhere other that in the editor that contains the phrase “sixty days”. There are some exceptions, but I’ll not complicate matters by bringing them all up—to keep things simple, just click into the text editor before searching this way and you should be fine. There is no “search index” for this type of search. That should work 100% of the time for you so long as that phrase is in the editor. :slight_smile:

If it doesn’t, there may be something wonky with the text, like an invisible character somewhere in between the words “sixty” and “days”. So do try and simplify by doing one-word searches first to make sure the basic principles are working. You can tell if there is an invisible character by just tapping the left or right arrow key through the phrase. If it “stutters” at any point, then you’ve got more characters than you can see—just select the whole phrase and type it in again.

This type of search box is never global. You could maybe say it is “global” if you click on Draft and make a huge Scrivenings session out of it and then search. It’s not true global search, but it certainly would be using the entire draft at that point to look for your phrase.

Truly global searching is done in the application toolbar, or with Edit/Find/Project Search… if you can’t find the tool. This mode is completely different. There is no search window like this, what you type into the search bar is actively searched for in the Binder sidebar immediately. It doesn’t find individual words (though it will highlight them for you in the editor), but instead it will find documents with that word. If you want a practical example of that in another program: think of how Mail works. If you search in Mail’s toolbar for an e-mail address, it will compile a list of e-mail messages in the main window. You then click on those to view them, and then you can use the pop-up search to scan the text of the e-mail message. It’s exactly the same principle in Scrivener, even if some of the mechanics are slightly different (Mail doesn’t use a full search window such as in your screenshot, any longer, but a little slide-out panel instead—same idea though: one search finds documents (e-mail messages), the other search finds words.

Anyway, I just wanted to clear that up so you don’t expect this find window to be global in the future.

Perhaps I’m misusing the term ‘global’ - what I meant was that normally, it used to be (on my old computer) that a search would search the whole of a document, both back and forward.
No, it’s not that I haven’t clicked into the editing pane; of course I have! How, otherwise, would I be using its search! And this error comes up randomly whether I’m searching for a single word or a phrase.
It is also random on exactly how it operates wrongly. For instance, I’ve just searched for the word ‘morrow’, in a short document I know contains it. The search failed to find the word in the document, but immediately went to a comment containing it. Then I went to the beginning of the document and searched again, and it found it, but the result was hidden behind the search dialogue (not a biggie, but a behaviour new to Scrivener for me).
Last night I was searching the same document, and getting only error hoots.
This kind of thing is what used to be greeted by Mac users with a chorus of “Trash the Prefs”. Is there a preference that might be causing it to behave oddly?

You could maybe try a reset. I wouldn’t think that the overall application preferences are at fault, given the nature of the error, but it could be the project’s view settings are at fault. Click on the File menu and hold down the Option key, you’ll see a new item appear, click “Close Project and Clear Interface Settings”. When it re-opens, the project window will be reset to the defaults, with nothing selected. Select a document and see if you can search for a word that is in view and then back again to test find wrapping (or “global” as you put it).

That scared the living bejasus out of me; perhaps I shouldn’t have used my central research document. It came back with the Research and Draft folders closed, so it looked as if all the contents had disappeared!
They hadn’t, thank goodness; however, it’s removed all the file colours in the Binder (got them back by telling it to show them there), and changed the view size.
Has it fixed the search? Hard to say. It found various single words; it also found a phrase, but did that annoying thing of finding it but hiding the text found behind the Search dialogue box (on second and subsequent finds of the same phrase).

Sorry about that, I should have put what I said in bold: When it re-opens, the project window will be reset to the defaults, with nothing selected. :slight_smile:

That reset doesn’t touch any data at all, you should be just fine. All it does is reset your project settings such as whether the Label is applied to icons, if titles are shown in Scrivenings, and so forth. You may have to set things up a bit again.

Well the main issue we are trying to resolve is the broken search that wasn’t finding words or wrapping at the end/beginning of the document. Whether the window has been positioned as such so that it obscures your text is something you can resolve by dragging the Find window to another location on your screen, no? Or if it is just always in the way, you can close it, it doesn’t need to be open to continue working. You would just use the Cmd-G and Shift-Cmd-G shortcuts to Find Next and Previous, respectively. Whatever works best for you though.

I could, I suppose. I kind of distrust that Find command generally, having (in my early days of Scrivener use, and when tired) occasionally accidentally wiped out a word by pressing Return, which sometimes seems to make it choose ‘replace’ rather than ‘find again’.

Thanks for your help, Io.

This is happening again. I’m in a file that I know contains the words “British Library”. in fact I’m looking at those very words, but searching for the word ‘library’ in the file (either ‘Next’ or ‘Previous’) brings only a sad hoot. I’m having to manually search up and down the file for the reference.
Edit: a couple of points. I again did that ‘Close project and clear interface settings’, and it again put the heart crossways in me by getting rid of the labels; I hope it didn’t also clear any comments; if it did, I’m fúcáilte ar fad fad, to put it mildly. The ‘Save and Rebuild Search Indexes’ item didn’t work at all.
And it would be nice to have a simpler way of having label colours shown than having to go into each menu item and check it separately; it’s kind of odd - why would anyone choose to use label colours unless they wanted them in the Binder at least, if not in the other options?