Advanced search with occurrence count criteria

edited August 2, 2018
Is it possible to search for a phrase in full-text and only show items where the phrase occurs more than N times?

I am trying to find articles that contain a phrase but in many articles' full-text the phrase occurs once or twice and such articles are not really about the said topic (or have a useful discussion or results on this topic).
  • Not possible, sorry.
  • OK, thanks for the prompt reply
  • edited December 30, 2018
    Hello @gurdas - as @dstillman says, it's not possible in Zotero. However, depending on how technically minded you are, the following may help. Your PDF files are indexed for full-text searching (see options) and if you do "Show file" you'll see a .zotero-ft-cache file alongside the PDF (in a directory called something like ../Zotero/storage/QAKSFY97 where QAKSFY97 is the ID of your file).

    You could go through the .zotero-ft-cache files (which are text files) and match phrases as you need to, recording the IDs. You can then relocate the files in zotero by searching for the ID (Edit: you can use any search type it seems - that may have changed recently). The ID isn't shown in the user interface afaik, but the search will find the item.

    But - all depends a bit on how much you want to code :)
  • @bjohas Did you mean that I write code that will open each .zotero-ft-cache file and count the occurrences for the search phrase?

    Not sure what this means "You can then relocate the files in zotero by searching for the ID".

    Also, my PDF files are attached to Zotero items as "link to file".
    @dstillman Is it possible to find the storage ID for an item in such a case. If I right-click an item, the show file just takes me to the PDF (which is not in Zotero storage)
  • The Copy Zotero Select Links function in Zutilo will end with the attachment item ID.
  • When you have copied the links as suggested you'll see how they relate to the storage location (for files that are attached to items, as they are in your case).

    That location also contains the .zt file. You then search in this (as you suggest). Bear in mond the files may only be partial, depending on your settings.

    You the have the storage is, plus the associated matches. How do you now find the item back in zotero?

    You could do this
    1. Manually by copying the id into the search box
    2. Via the API
    3. Or via an export format like scannable cite (or a variant thereof) that gives you the id together the bibliographic information (author, year, title etc)

    This may not be the best way, but this is how I'd do it. Sorry for brevity, am on mobile. Happy to post some details if it's useful!
Sign In or Register to comment.