"Airbus" AND (grève OR strike) NOT sport. The alert says which words matched and
where. This guide is for the people who write those queries and the operators who
set them up. The alerts plugin README is the
reference for the expression format. To alert on a subject rather than on words,
see described alerts.
Write a query
Rules:
- Operators.
AND,ORandNOTare written in capitals; in lower case they are ordinary words.NOTbinds tighter thanAND, which binds tighter thanOR: ina OR b AND c,b AND cis grouped first. Use parentheses when in doubt. - Case, accents and punctuation do not matter.
grevefinds “Grève”, andSaint-Denisfinds “Saint Denis”. - Words match whole.
busdoes not find “Airbus”, andstrikedoes not find “strikes”, because there is no stemming: list the forms you need, for examplestrike OR strikes OR striking. - Title and body are searched, not captions or other Parts, unless the operator
changes
text_roles. - Exclusions. Write
NOTto exclude a word; a leading-is refused. A query made only of exclusions (NOT sport) alerts on almost every article. - Nesting. Groups nest at most 6 levels deep, and a group holds at most 64 items.
- Colons. A word shaped
name:valueis a field filter. To search it as text, quote it:"re:Invent". A URL such ashttps://example.comstays text.
Save it as an alert
Quivr stores the query as a JSON tree, which it validates in full when the Subscription is created: a malformed query is a422 invalid_expression naming the
part at fault. Two mistakes still pass that check and never match: a term with no
letter or digit ("!!!"), and a field name the operator has not mapped (the plugin
logs a warning). To get the tree from the text, use the
plugin’s parser:
alerts evaluator:
Read what matched
Each alert is a Match.GET /v0/matches/{match_id} shows its evidence:
- Terms. The explanation lists the terms that made the article match, as written
in the query, and the Parts where each one was found. Terms under
NOT, and alternatives that did not match, are not listed. - Filters. A matched filter reads
Matched source "wire".
Set up metadata filters (operators)
These built-in filter names work everywhere:source: the Source Namespace;producer: the producer the client declared, or the Connector Instance;origin:clientorconnector;connector: the Connector Instance id;connector_kind: for examplerss.
author or category depend on where your sources store that
metadata, usually in a Version extension. Map them in the alerts pin’s
configuration, in the core’s startup config:
{"field": "/extensions/example.news/data/author", "equals": "Jane Doe"}; the text notation accepts only names.
Timing
A keyword alert is decided as soon as an article becomes searchable. To wait until the article is enriched instead, set{"wait_for_enrichment": true} in the
Subscription’s evaluator.configuration. The plugin then answers “not ready”, and
Quivr asks again once embeddings are attached.
In the local stack
make dev and make verify pin the alerts plugin next to pdf-text, from
plugins/alerts, with the built-in field names only. Its log is
.scratch/<project>/alerts-plugin.log. To run without it, start the stack with
QUIVR_ALERTS=off make dev; Subscriptions pinned to alerts are then refused with
422 unsupported_evaluator
(harness).