Odd keyword search behavior?

Sorry if this has been addressed before:

I have a number of documents in Scrivener, and I have “keyworded” each with either “lawful” or “unlawful.”

A keyword search for “lawful” returns them all – apparently because the word “unlawful” contains the word “lawful.”

It doesn’t seem to me that it should return results that way; e.g., a search for “fiction” returning “non-fiction” etc. Makes searching on keywords kind of trickier, no?

In the drop-down selection of the search bar, choose “whole word” and it will fix this. Or you can use the search function from the Keyword HUD, which essentially does the same thing.

Ah… actually, the “whole word” option does do the trick, but the keyword search in the hud still returns “unlawful” when I search for “lawful.”

If I create a keyword “a” and then do a keyword search from the hud for “a,” I get every document that is assigned any keyword that contains the letter “a.”

So it does, I apologize. I messed up when I was testing that. That one does seem like it ought to do a “whole word” sort of thing by default, since the interface makes it appear to search for only the selected keyword. But anyway, I’m glad the other search function does the trick.

Yeah – glad that works too, and thanks for the tip. I do think that the keyword HUD almost needs to function differently in this regard… since unless I’m mistaken, there is no way to search for all documents that include (e.g.) the words “fiction” and “science” that doesn’t also include documents with the keywords “nonfiction” and “science.” In the HUD, you should ideally be able to cmd-click several keywords, and effect such a search. Maybe creating some kind of collection first, and searching within that, but I really haven’t looked into how collections work yet…

There’s no perfect way of doing this. Currently when you do a keyword search it searches all words, so yes, it returns some partial results. But even if it used “whole word”, then it could still return “White City” for “White”. And if it used “exact phrase”, it wouldn’t be able to find a multiple selection of keywords, which get entered into the search field separated by commas. So it uses a best-fit, which you can then refine using the search menu.

All the best,

Well the obvious solution is just to use “Gondor” instead of “White City.” :slight_smile:

Surely you mean Minas Anor (in Sindarin, The Mundburg to the Rohirrim), renamed to Minas Tirith after Minas Ithil was captured and renamed to Minas Morgul!

[size=60]That’s a little long for a keyword, though, and means that All References Lead To Gondor, due to the proliferation of “Minas” in the search results.[/size]

MA(TMtR)reMTpostMI=MM ?

…How 'bout just coloring it white and then skimming through the corkboard?


I agree that this is a real irritation since keywords are integral to tracking material in Scrivener.

I use the name of a character as a keyword but also use “Intro: Character Name” and “Mention: Character Name” to track when they’re first introduced and when they’re mentioned but don’t appear. Yet, when I search for either the “Intro” or “Mention” instance, I get ALL instances, including where the character actually DOES appear.

Why can’t the search box in the Keyword HUD allow an “exact” search like the regular search box, which is much more intuitive. If you select more than one, only the “exact” ones appear.

This would be very helpful in using the keywords as intended without obscuring the need for broader searches. If that’s not what you want, use the regular search box. (BTW, if there’s a workaround to it, I can’t find it.)

I hope this is something that can be provided soon. Thanks for all the great work on a great program.

The reason for this is because the keyword search just provides a shortcut to the main search. So if you select more than one keyword, an exact search just won’t work, because there will be multiple keywords entered in the search field, which will match nothing exactly.

What I can do is change it so that it uses “exact phrase” if only a single keyword is selected for the search. You can do this yourself by using the search options in the main window’s search field, too, of course.

All the best,

P.S. Didn’t we have this discussion before at some point? Your examples ring a bell.