unlinked items & other questions

Question 1 : would I do any damage to the zot datadict if I manually delete items found under the datadict path but are not found in zot?

For example. By searching on the OS level for a filename of a PDF I found three instances.

dataDict\storage\7QQHRSGE\Diehl et al. - 2004 - Agency and communion attributes in adults' spontan.pdf
dataDict\storage\HVZZZIHX\Diehl et al. - 2004 - Agency and communion attributes in adults' spontan.pdf
dataDict\storage\UM6ENIJ3\Diehl et al. - 2004 - Agency and communion attributes in adults' spontan.pdf

However, when searching in zot I only found one of the three when searching by author "Diehl"

Could I manually delete the other two using an OS delete without damaging the datadict/sqlite interconnection?

QUESTION 2 : Is there a way to find all of these files using zot? That is, other instances of where there is an OS level file under the datadict path, but zot/sqlite is unaware of it.

QUESTION 3 : Is there a way to search for unindexed attachments? I have added "Item Type" as a column, and can sort by that to find attachments, but I see no way to filter that down to only unindexed attachments. There is the "notIndexed" virtual collection (saved search), but many of the attachments it finds are indeed indexed.

QUESTION 4 : If an item is not indexed and it has no parent item, then can a zot search find it at all, except by filename?


  • would I do any damage to the zot datadict if I manually delete items found under the datadict path but are not found in zot?
    Generally speaking, you shouldn't touch the data directory — it's intended to be managed by Zotero. For the example above, e.g., an item might be in multiple libraries. Purging of truly orphaned files will likely be handled by Zotero in an upcoming version.
    Is there a way to search for unindexed attachments?
    I'm not sure what you mean by "unindexed attachments". The Unfiled Items virtual collection is for items not in any collection. If you mean indexing as in full-text content indexing, that's, again, not something you should need to worry about — it's something Zotero should take care of. If you find there's a file that wasn't indexed for some reason, you can click the Index button, but there's no way to search for those.
    If an item is not indexed and it has no parent item, then can a zot search find it at all, except by filename?
    You can search by the visible fields: attachment title, URL, tag, and embedded note.
  • edited September 20, 2022
    I defer to @dstillman on the wisdom of messing with anything in your Zotero\storage folder.

    There are several ways to get a simple list of what attachments Zotero DOES know about (that is, are in its database).

    The Zutilo add-on can copy a list to the clipboard of ALL attachment files - for the SELECTED items - that Zotero knows about ('Copy attachment paths'). That list contains not just PDFs, and not just locally stored files.

    If you want to know which attachment PDF files in your local storage folder ARE in Zotero's database, this code run under Tools\Developer\Run Javascript should show you that list. As always, there may be a simpler or more elegant way of doing this. ;)

    var sql = "SELECT (? || '\\storage\\' || key || REPLACE(path,'storage:','\\')) AS filepathnames FROM itemAttachments JOIN items USING (itemID) WHERE libraryID=1 AND path IS NOT NULL AND path LIKE ? ORDER BY filepathnames";
    var filepathnames = await Zotero.DB.columnQueryAsync(
    sql,
    [
    Zotero.DataDirectory.dir,
    'storage:%.pdf'
    ]
    );
    return filepathnames.join('\n');






Sign In or Register to comment.