Skip to content

after_extract

after_extract(items, ctx) receives all extracted items at once. Good for cross-item logic, dedup, or sorting.

No short-circuit: returning nil or empty table just means no items, not a pipeline abort.

function after_extract(items, ctx) -> table
Field Type Description
items array Array of item tables

Each item has:

  • item.fields - table (string→string)
  • item.matches - READ-ONLY: Populated by engine
Return Effect
Array of items Continue with modified items
Empty table / nil / false No items to process
function after_extract(items, ctx)
-- Remove duplicate titles
local seen = {}
local unique = {}
for _, item in ipairs(items) do
local title = item.fields.title or ""
if not seen[title] and title ~= "" then
seen[title] = true
table.insert(unique, item)
end
end
return unique
end