update_tags: Add or remove tags to/from documents by query or ID

View source: R/query.R

update_tagsR Documentation

Add or remove tags to/from documents by query or ID

Description

Add or remove tags to/from documents by query or ID

Usage

update_tags(
  index,
  action,
  field,
  tag,
  ids = NULL,
  queries = NULL,
  filters = NULL,
  credentials = NULL
)

Arguments

index

The index to query

action

'add' or 'remove' the tags

field

The tag field name

tag

The tag to add or remove

ids

A vector of ids to add/remove tags from

queries

An optional vector of queries to run (implicit OR)

filters

An optional list of filters, e.g. list(publisher='A', date=list(gte='2022-01-01'))

credentials

The credentials to use. If not given, uses last login information

Examples

## Not run: 
set_fields("state_of_the_union", list(test = "tag"))
update_tags(
  index = "state_of_the_union",
  action = "add",
  field = "test",
  tag = "test",
  filters = list(party = "Republican",
                 date = list(gte = "2000-01-01"))
)

## End(Not run)

ccs-amsterdam/amcat4r documentation built on April 17, 2025, 3:22 a.m.