Repository navigation
Is there a way to limit semantic search to a subset of our whole library? #460
Replies: 1 comment
|
Not at query time, no — and it's a gap rather than something you're missing, because the other search tools do have it.
def semantic_search(
query: str,
limit: int = 10,
filters: dict[str, str] | str | None = None,
library_id: int | str | None = None,whereas
metadata = {
"item_key": item.get("key", ""),
"item_type": data.get("itemType", ""),
"title": data.get("title", ""),
"date": data.get("date", ""),
"date_added": data.get("dateAdded", ""),
"date_modified": data.get("dateModified", ""),
"creators": format_creators(data.get("creators", [])),
"publication": data.get("publicationTitle", ""),
"url": data.get("url", ""),
"doi": data.get("DOI", ""),
}plus a What does exist is scoping when the database is built. The indexer takes a collection list: local_items = reader.get_items_with_text(limit=limit, include_fulltext=False, collection_keys=collection_keys)so the semantic DB can be restricted to chosen collections rather than the whole library. That fits if you always search the same couple of sub-collections — build the index over just those and every query is implicitly scoped. It doesn't help if you want to switch scope per query, since it's a property of the database rather than the search. I couldn't find a documented CLI flag exposing For your actual ask, the clean feature request is adding |
Uh oh!
There was an error while loading. Please reload this page.
Firstly, thank you to the maintainers and contributors for this great work.
My question revolves around the possibility of limiting the semantic search to only a subset of the entire Zotero library. For example, in my "My Library," I have grouped collected references into sub-collections. Can I limit the connected model to only a specific sub-collection or two at once?
Thank you so much.
All reactions