Skip to main content
View plugin source · Plugin ID · Plugin API NewsML-G2 reads the XML before Quivr indexes the story.
NewsML-G2 reads XML news items and messages so you can search their headlines and text.NewsML-G2 reads XML news items and messages so you can search their headlines and text.

What it does

A format plugin turns a file into searchable parts. NewsML-G2 reads IPTC news XML, keeping article text, photo captions and metadata together with the source file.

Before you start

Check the XML root. Use application/vnd.iptc.g2.newsitem+xml for a newsItem and application/vnd.iptc.g2.newsmessage+xml for a newsMessage that wraps news items.

Enable it

Single Machine and Railway include both routes. For a local checkout, select QUIVR_NORMALIZER=newsml-g2 when you start the standard make dev stack. For an external plugin process, pin the plugin and add required routes for both media types.

Use it

Find a story from an XML export

  1. Follow Upload a file with one XML file. Use the matching media type in both the upload and the document submission.
  2. When the receipt for your submission reports availability.searchable: true, use keyword search (mode: lexical) to look for words from a headline, slugline, supported paragraph or caption. For the sample news message, search for “ferry departs at noon”.
  3. Once a single file works, use the same media type in the connector’s settings to import an archive of files of that type.

Settings

The plugin defaults to 1 MiB of XML input and 256 KiB of extracted text. Leave header_paths unset unless you need specific XML headers as structured metadata.

What it produces

Quivr can search headlines, sluglines and supported paragraph text, including text in XHTML or NITF. A message with multiple news items keeps their order. Picture items can also supply caption text and image reference metadata. Submit the image bytes separately if you want to search the pixels. The original XML stays attached.

Limits and troubleshooting

  • Malformed XML or a document with a DTD or entity declaration is refused. Check the XML source and the declared media type.
  • XML over the input cap and extracted text over the text cap are refused. Submit smaller documents.
  • If the file publishes with no_text_parts, inspect the original XML for a headline, slugline, caption or supported paragraph. Quivr can keep the source even when there is no searchable text.
Object storage archive reads the files in an archive. Image metadata reads metadata from the image files themselves.