Problem with keyword and custom metadata searches.

tb
tbrown313
Posts: 72
Joined: Mon May 04, 2015 2:00 pm
Platform: Mac
Location: Portland, OR

Mon Jan 13, 2020 10:15 pm Post

I have a project with lots (around 500) of pdf files used as references. These files were imported to the project with the "Import Research Files as Aliases" menu item, so they have the icon of a pdf file with the small arrow.

I have organized all of these files with lots of custom meta data, and also with keywords. I use all this like a database to select and sort all the files based on content, date, etc.

However, I am currently seeing an error in Scrivener's selection in at least one of my folders. I created a keyword called "Editorial Comment" and it is used on a few dozen files. I did a search for that keyword, then put all of the files found into a collection called Editorial Comment. However, at least one entire folder in the project is left out of the search for some reason. I can look at individual files in that folder and see that they have the keyword applied to them in the inspector, but they are not included in the search. This is not a problem with adding files and not redoing the search to add the files to the collection. I can do a new search, and the files are not found even though they have the keyword.

This particular directory appears to be left out of most (all??) searches of this type. I have a piece of custom metadata I call "Type" and the files in this directory are also left out of searches even though they have the Type entry I am searching for.

I can't find any differences between this folder and others. They are outside the draft folder, at the same level of hierarchy, and their properties in the inspector seem the same.

Any ideas as to what to do about this?
Terry Brown

St
SteveCarterFrogstory
Posts: 75
Joined: Fri Feb 22, 2013 7:35 pm
Platform: Windows

Tue Jan 14, 2020 12:53 am Post

Maybe on that folder you have "Include in compile" checked in the inspector, but your search criteria has "Search 'included' documents unchecked.

tb
tbrown313
Posts: 72
Joined: Mon May 04, 2015 2:00 pm
Platform: Mac
Location: Portland, OR

Tue Jan 14, 2020 1:28 am Post

Both the folder that doesn't work and other folders that do work have include in compile checked.
Terry Brown

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

Tue Jan 14, 2020 4:19 pm Post

To rule out any issues in the search index itself, you should hold down the Option key on the File menu, and select File ▸ Save and Rebuild Search Indexes.... Once that process concludes, you should be able to test whether searching works immediately, but feel free to reload if you wish.

The other common thing to check is to reset your search settings. Click the magnifying glass icon, and select “Reset Search Settings” at the bottom. This won’t ordinarily impact keyword searches that you execute from the Keywords panel, however—those use their own built-in settings rather than your current project search settings.
.:.
Ioa Petra'ka
“Whole sight, or all the rest is desolation.” —John Fowles

User avatar
rdale
Posts: 2014
Joined: Tue Jul 14, 2015 1:07 pm
Platform: Mac, Win + iOS
Location: St. Louis, MO
Contact:

Tue Jan 14, 2020 6:56 pm Post

This isn't directly related to your issue, but do keep in mind that if you have a space in your keyword, searching for that keyword can turn up any documents tagged with keywords that contain any of the words within your keyword. :roll:

To clarify:

Your keyword "Editorial Comment" contains two distinct words, separated by a space.
If you were to create another keyword like "Editorial Sneakiness", and another named "Editorial Tomfoolery", documents tagged with those other keywords might show up in your search, since the search treats "Editorial" as a partial match to all 3 keywords.

The way to avoid that is to rename your keywords to have no spaces. You can use underscores or run the capitalized words together (Editorial_Comment or EditorialComment) as methods to avoid this kind of issue.
FKA: robertdguthrie
AKA: R Dale Guthrie, Robert, Mr. Obscure, and "Oh, it's you again".

tb
tbrown313
Posts: 72
Joined: Mon May 04, 2015 2:00 pm
Platform: Mac
Location: Portland, OR

Thu Jan 16, 2020 10:01 pm Post

Amber,

I think that the "save and rebuild search indexes" fixed this. It is now working as I expect. I had previously closed the project, closed Scrivener, and reopened, which I thought did the same thing, but still had the problem. Could have been fooled by looking at a saved collection rather than the active search, though.

rdale:

Thanks for the tip. I wasn't aware of this and will rename my offending keywords. However, regarding your examples:

I am writing about my experiences trying to sell science fiction in the 70s and I have a lot of scanned editorial letters that I have tagged "Editorial Comments" to distinguish them from form rejection slips. I can't imagine why one would need keywords like "Editorial Sneakiness" or "Editorial Tomfoolery". :)

I got a real kick out of those--thanks.
Terry Brown

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

Fri Jan 17, 2020 4:30 pm Post

I had previously closed the project, closed Scrivener, and reopened, which I thought did the same thing, but still had the problem.


It is usually pretty good about detecting when its search index is broken, and will trigger an automatic rebuild when so. But I do think specifically for things like indexed PDF files (and especially anything aliased to the disk), it wouldn’t be possible to have a tripwire for that, so it could go years opening and closing without rebuilding.

Hopefully a piece of trivia you never have to be aware of again though. :)
.:.
Ioa Petra'ka
“Whole sight, or all the rest is desolation.” —John Fowles