Loading TOC...


   config as element(configuration),
   database-id as xs:unsignedLong,
   value as xs:string
) as element(configuration)


This function specifies whether to use the default term-frequency normalization (scaled-log), which scales the term frequency based on the size of the document, or to use the unscaled-log, which uses term frequency as a function of the actual term frequency in a document, regardless of the document size.

config A configuration specification, typically as returned from one of the Admin module functions.
database-id The ID of the database (for example, xdmp:database("myDatabase")).
value The new term-frequency normalization setting. Must be one of: scaled-log or unscaled-log.

Required Privileges

This operation requires at least one of the following privileges:






  xquery version "1.0-ml";

  import module namespace admin = "http://marklogic.com/xdmp/admin"
      at "/MarkLogic/admin.xqy";

  let $config := admin:get-configuration()

  let $db := admin:database-get-id($config, "myDatabase")

  return   <apidoc:param name="config" type="element(configuration)">
     A configuration specification, typically as returned
     from one of the Admin module functions.
   <apidoc:param name="group-id" type="xs:unsignedLong">
     The name of the group.
      admin:database-set-tf-normalization($config, $db, "unscaled-log")

  (: Sets the term-frequency normalization setting to "unscaled-log" for the
     database, "myDatabase."  Use admin:save-configuration to save the changes
     to the configuration or pass the configuration to other Admin API functions
     to make other changes. :)

Stack Overflow iconStack Overflow: Get the most useful answers to questions from the MarkLogic community, or ask your own question.