whiskyechobravo / kerkoapp

A web application that provides a faceted search interface for bibliographies managed with Zotero.
https://whiskyechobravo.github.io/kerko/
BSD 3-Clause "New" or "Revised" License
68 stars 24 forks source link

KERKOAPP_COLLECTION_FACETS not working for me #32

Closed saurabhsindhu closed 1 year ago

saurabhsindhu commented 1 year ago

Hi there,

We are working on Kerko customisation. We have library at Zotero : https://www.zotero.org/transplantid/library

We want the library folder name (on Zotero) to be Title checkbox selections on the left side of the home page on Kerko. We tried using KERKOAPP_COLLECTION_FACETS (collection_key:weight:'Folder title from Zotero') but it's showing error in the log : "No field named 'collection_facet_IDCXNCZB'"

(from https://api.zotero.org/users/../.) "key": "IDCXNCZB", "version": 7, "library": { "type": "user", "id": 4330545, "name": "Joseph", "links": { "alternate": { "href": "https://www.zotero.org/transplantid", "type": "text/html" } } },

KERKOAPP_COLLECTION_FACETS=IDCXNCZB:110:Adenovirus; 87WUEM2D:120:IDSA Guidelines; M52HNJVH:130:AST Guidelines 2019

Please let me know what am I doing wrong?

davidlesieur commented 1 year ago

Have you run the following command?

flask kerko clean index

It is required after changing a setting that alters Kerko's data structures. Once this is done, you may try rebuilding the index:

flask kerko sync index

I hope this helps.

Aside from that, I gave a quick look at your library. The collections you have selected for KERKOAPP_COLLECTION_FACETS don't have any subcollections, which means that the 3 facets won't show up in Kerko. Kerko maps the selected top-level collections to facets, and the subcollections to filters under the facets. If there are no subcollections, then there is nothing to show under the facets.

To solve this, you might want to create a top-level collection in Zotero (say "Subject"), then move Adenovirus, IDSA Guidelines, AST Guidelines 2019 under it (as subcollections). Then set KERKOAPP_COLLECTION_FACETS=XXXXXXXX:110:Subject, where XXXXXXXX is the ID of the top-level collection. Once you see the result, I think you'll get the gist, then it will be easy for you to think of a more useful structure than my example.

Of course, keep in mind to clean the index and re-sync after each change to KERKOAPP_COLLECTION_FACETS.