MarkLogic 9 Product Documentation
clang:update-user-language

clang:update-user-language(
   $config as element(lang:user-languages),
   $user-lang as element(lang:user-language)
) as element(lang:user-languages)

Summary

Add or replace a configuration item for a language in the given language configuration item, and return the new configuration.

Parameters
config A custom language configuration specification, typically as returned from one of the custom language module functions.
user-lang The configuration definition for a language, as constructed by clang:user-language.

See Also

Example

xquery version "1.0-ml";
import module namespace clang = "http://marklogic.com/xdmp/custom-language" 
  at "/MarkLogic/custom-language.xqy";

let $lexer := clang:lexer("special_lexer","NFD")
let $stemmer := clang:stemmer("special_stemmer","NFC",("keep-short-vowels=true"))
let $plugin := lang:user-language-plugin("native/special",$lexer,$stemmer)
let $lang := clang:user-language("ca",$plugin)
let $config := clang:language-config-read()
let $config := clang:update-user-language($config,$lang)

(: NOTE: calling clange:language-config-write causes a restart :)
return clang:language-config-write($config)
    
Powered by MarkLogic Server | Terms of Use | Privacy Policy