More powerful saved searches?

Does the UI selection for a saved search result in a SQL query behind the scenes? Might it be possible to expose this to the user in text form and then allow the user to edit the query or to supply their own code? This is possible in Biblioscape and was very helpful for custom searchers and custom sorting of the results beyond the options supported by the UI.

Here is an example:

select Ref_ID, Folder, Folder_ID, Priority, Ref_type_ID, Year_pub, Authors, Title, Sec_title, Categories, Ref_Mark, Icon_au, Date_Freeform from bib where Deleted IS NULL and (UPPER(Ref_Type) = UPPER('Grant')) and (UPPER(Authors) like UPPER('%Smith%') or UPPER(Sec_Authors) like UPPER('%Smith%')) order by COALESCE(CAST(Year_pub AS VARCHAR(4)),
CASE WHEN RIGHT(date_freeform, 4) = 'oing'
THEN '9999'
ELSE RIGHT(date_freeform, 4)
END
) DESC,
date_freeform DESC
  • I don't see us doing that — we'd focus on simply improving what you can do via the UI — but you can run arbitrary code in the Run JavaScript window and create/update a collection from a set of item ids. I'd recommend using the Zotero.Search interface over SQL, though. There's limited documentation for this beyond that page and the source code itself, but we can point you in the right direction if you have a specific goal in mind.

    There's also been talk of allowing custom user scripts to be saved and retrieved in that window.
Sign In or Register to comment.