The Search Function Doesn't Work

Hello, just joined so I can have this figure out.

I don’t understand why this is so difficult. I have a saved collection of words that I don’t want to use. For this example, I want to search for the word ‘is’, in the search results I get EVERY word that has ‘i’ and ‘s’ together. So words like ‘finished’ or ‘his’ show up, thereby polluting my search results.
When I search with ‘Whole Word’ nothing changes, have still have words that I don’t want, why doesn’t ‘Whole Word’ just remove the offending words? Nothing in the search function allows for this. I must be doing something wrong.

I even tried “is” in quotes, and it doesn’t work.

Second to this, there is an option to ‘Search Included or Excluded Documents’ and yet I see no way to include or exclude a particular document.

Please help because this is annoying as hell.

For further context, the list of words are separated with commas.

Hi. There is some conflict in your description.

You can’t search for “any word” and “whole word” at once. (I think.)
You’d need a Regex for that.

Included and excluded refer to whether a document is set to compile or not.

I don’t understand what you’ve replied with. I keep reading my post for “any word” and I didn’t state that, I’m simply confused overall so any clarity will help. Selecting Regex does nothing by the way.

Full documentation of the search function can be found in Section 11.1 in the manual.

Don’t separate search terms with commas, unless you also want to search for comma characters.

In my test, a Whole Word search for is had the expected results, returning only the exact word.

A Whole Word search for is text returned only that phrase. It did not return documents which had ‘is’ and ‘text’ separately.

An All Words search for is text returned both words separately, but also returned documents with ‘finished,’ ‘textual’ and so on.

The trick is to put the word and adjacent spaces in quotation marks. So, an All Words search for " is " " text " will return documents containing both the word ‘is’ and the word ‘text,’ but will not return ‘finished,’ etc.

If you’re getting anomalous results, be sure to check the other search options. Especially if you’re looking for overuse of common words, remember that the Synopsis and Notes can contain them, too.

2 Likes

To combine the two requirements—searching for any of a list of words and each of those words being considered a whole word—I’d use the RegEx option. With that, you can indicate word boundaries (so the match isn’t adjacent to other word characters) as well as a tight optional word list.

For example, to search for documents containing any of the whole words “is”, in", or “an”, you’d use this: \b(is|in|an)\b

  • \b marks the word boundary, so with one at the start and end you’re saying that “is” counts but neither “isn’t” nor “this” do.
  • ( ) sets off the group, so the boundaries apply to each item in it.
  • | acts as an or in separating the terms: match “is” or “in” or “an” but not necessarily all of them.

A benefit to this method is that the word boundaries don’t have to be spaces specifically; you could have other punctuation adjacent to the word and this will still find it.

1 Like

I did a Project Search on is and all is well. See settings used. It ignores is in other words.

1 Like

Okay, thank you for this, progress is being made on my end. I have successfully got all my words that I want to investigate to appear.

My next problem to solve, is Scrivener able to ignore the same words inside dialogue text, while highlighting the same words in the narrative text?

Thank you for confirming, the trick as kewms shared is the double quotes. All my words show up. Now I want to fine tune the search to a greater degree by either ignoring parts of the project and/or having the search ignore the same words I wanted to find inside dialogue.

. . . . . . . . .

You can narrow the scope of the search to just the Draft folder, to just the selected documents, or based on the Include in Compile flag. There’s no way to include/exclude dialogue, though. (Unless RegEx can do it, which I’m not knowledgeable enough to say.)

1 Like

Where is the compile flag? I have seen some options to compile the PDF (which I knew about) and there is something else that doesn’t do anything called ‘Outliner Options’.

How can I remove a document on a long term basis? Thank you again.

image

image

They’re all (3) the same setting.

That’s the included/excluded you asked about, regarding search, earlier.

You’re saying with this function that is outside of the search function already discussed, this is the way to remove documents I would have checked, from future searches?

This determines whether a document will be included or not in a compile, if present in the compile list (my second screenshot is “the list”).

And it also serves as a search criteria.
image

If you don’t ever want a document to compile (notes, for e.g.), set it as excluded (unchecked) and you won’t ever have to worry about it. (It will never compile. Unless you filter the compiler and tell it to compile excluded documents.)

1 Like

Wow, thank you, such a combination of settings. I’m eternally grateful.

2 Likes