actorizer, ud_update: Updated merging of document fields to properly deal with missing punctuation at the end of fields (e.g. a title without punctuation at the end of the string)
modelizer: Minor update to feature keyness, using absolute values now to determine the most informative features for a class (so features that are either strongly postively or negatively related to the class)
bulk_writer: Added the 'ver' parameter to include a short version string with each update. Mostly to deal with updates that do not complete successfully on all data
#' @param index The name of the Elasticsearch index to update
#' @param index The name of the Elasticsearch index to update
#' @param varname String indicating the parent variable that should be updated (when it does not exist, it will be created, all varnames are prefixed by computerCodes)
#' @param varname String indicating the parent variable that should be updated (when it does not exist, it will be created, all varnames are prefixed by computerCodes)
#' @param type Type of updating to be done, can be either 'set', 'add', or 'addnested'
#' @param type Type of updating to be done, can be either 'set', 'add', or 'addnested'
#' @param ver Short string (preferably a single word/sequence) indicating the version of the updated document (i.e. for a udpipe update this string might be 'udV2')
#' @return A string usable as Elasticsearch bulk update command, in line-delimited JSON
#' @return A string usable as Elasticsearch bulk update command, in line-delimited JSON
#' @export
#' @export
#' @examples
#' @examples
#' bulk_writer(x, index = 'maml', varname = 'updated_variable')
\title{Generate a line-delimited JSON string for use in Elasticsearch bulk updates}
\title{Generate a line-delimited JSON string for use in Elasticsearch bulk updates}
\usage{
\usage{
bulk_writer(x, index = "maml", varname = "updated_variable", type)
bulk_writer(x, index = "maml", varname, type, ver)
}
}
\arguments{
\arguments{
\item{x}{A single-row data frame, or a string containing the variables and/or values that should be updated (a data frame is converted to a JSON object, strings are stored as-is)}
\item{x}{A single-row data frame, or a string containing the variables and/or values that should be updated (a data frame is converted to a JSON object, strings are stored as-is)}
\item{varname}{String indicating the parent variable that should be updated (when it does not exist, it will be created, all varnames are prefixed by computerCodes)}
\item{varname}{String indicating the parent variable that should be updated (when it does not exist, it will be created, all varnames are prefixed by computerCodes)}
\item{type}{Type of updating to be done, can be either 'set', 'add', or 'addnested'}
\item{type}{Type of updating to be done, can be either 'set', 'add', or 'addnested'}
\item{ver}{Short string (preferably a single word/sequence) indicating the version of the updated document (i.e. for a udpipe update this string might be 'udV2')}
}
}
\value{
\value{
A string usable as Elasticsearch bulk update command, in line-delimited JSON
A string usable as Elasticsearch bulk update command, in line-delimited JSON
@ -26,5 +28,5 @@ add: add x to the values of [varname]
varname: When using ud, the ud field will be updated instead of a computerCodes field
varname: When using ud, the ud field will be updated instead of a computerCodes field
}
}
\examples{
\examples{
bulk_writer(x, index = 'maml', varname = 'updated_variable')