Odd keyword search behavior?

gr
gravytop
Posts: 17
Joined: Wed Oct 27, 2010 8:09 pm
Platform: Mac + Windows

Fri Mar 04, 2011 11:18 pm Post

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?

User avatar
MimeticMouton
Posts: 9042
Joined: Wed May 05, 2010 5:39 am
Platform: Mac + Windows
Location: city of rain
Contact:

Fri Mar 04, 2011 11:20 pm Post

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.
Jennifer Hughes
(MM for short)

gr
gravytop
Posts: 17
Joined: Wed Oct 27, 2010 8:09 pm
Platform: Mac + Windows

Fri Mar 04, 2011 11:34 pm Post

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."

User avatar
MimeticMouton
Posts: 9042
Joined: Wed May 05, 2010 5:39 am
Platform: Mac + Windows
Location: city of rain
Contact:

Fri Mar 04, 2011 11:38 pm Post

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.
Jennifer Hughes
(MM for short)

gr
gravytop
Posts: 17
Joined: Wed Oct 27, 2010 8:09 pm
Platform: Mac + Windows

Sat Mar 05, 2011 2:41 am Post

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...

User avatar
KB
Site Admin
Posts: 20922
Joined: Tue Jun 13, 2006 11:23 pm
Platform: Mac
Location: Truro, Cornwall
Contact:

Tue Mar 08, 2011 2:08 pm Post

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,
Keith
"You can't waltz in here, use my toaster, and start spouting universal truths without qualification."

User avatar
MimeticMouton
Posts: 9042
Joined: Wed May 05, 2010 5:39 am
Platform: Mac + Windows
Location: city of rain
Contact:

Tue Mar 08, 2011 5:54 pm Post

Well the obvious solution is just to use "Gondor" instead of "White City." :)
Jennifer Hughes
(MM for short)

User avatar
AmberV
Posts: 24805
Joined: Sun Jun 18, 2006 4:30 am
Platform: Mac + Linux
Location: Ourense, Galiza
Contact:

Thu Mar 17, 2011 12:30 am Post

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!

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.
.:.
Ioa Petra'ka
“Whole sight, or all the rest is desolation.” —John Fowles

User avatar
MimeticMouton
Posts: 9042
Joined: Wed May 05, 2010 5:39 am
Platform: Mac + Windows
Location: city of rain
Contact:

Thu Mar 17, 2011 12:41 am Post

MA(TMtR)reMTpostMI=MM ?

...How 'bout just coloring it white and then skimming through the corkboard?
Jennifer Hughes
(MM for short)

la
larykirk
Posts: 16
Joined: Sun Jul 12, 2009 9:24 pm

Sun Jul 24, 2011 7:35 pm Post

Keith,

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.

User avatar
KB
Site Admin
Posts: 20922
Joined: Tue Jun 13, 2006 11:23 pm
Platform: Mac
Location: Truro, Cornwall
Contact:

Sun Jul 24, 2011 7:44 pm Post

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,
Keith

P.S. Didn't we have this discussion before at some point? Your examples ring a bell.
"You can't waltz in here, use my toaster, and start spouting universal truths without qualification."