|
|
info:database-create(
|
|
$database-name as xs:string,
|
|
[$forests-per-host as xs:positiveInteger?],
|
|
[$group as xs:string?],
|
|
[$data-directory as xs:string?],
|
|
[$security-db as xs:string?],
|
|
[$schemas-db as xs:string?],
|
|
[$triggers-db as xs:string?]
|
| ) as xs:unsignedLong |
|
 |
Summary:
This function creates a database with attached forests. Forests are named sequentially using the
pattern of databasename-1, databasename-2 and so on. The API checks for database and forest name conflicts,
throwing an INFO-DUPLICATENAME error if any name conflicts are encountered. The database is
created with default index settings. If $forests-per-host is an empty sequence or
omitted, only one forest (regardless of number of hosts) is created. If database creation succeeds,
the database id is returned.
|
Parameters:
$database-name
:
Name of this database.
|
$forests-per-host
(optional):
The number of forests to create per host in the group. Defaults to one forest for the database
if not provided.
|
$group
(optional):
The name of the group to which to add forests.
The API determines which hosts are in the group and creates the
specified number of forests for each host in the group.
If not provided, the Default group is used.
|
$data-directory
(optional):
A public data directory to use for forest creation. Default is none, resulting
in a private data directory (server default).
|
$security-db
(optional):
The name of the security database to use for database creation.
Defaults to Security if not provided.
|
$schemas-db
(optional):
The name of the schema database to use for database creation. Defaults to Schemas if not provided.
|
$triggers-db
(optional):
The name of the triggers database to use for database creation.
Defaults to Triggers if not provided.
|
|
Example:
xquery version "1.0-ml";
import module namespace info = "http://marklogic.com/appservices/infostudio"
at "/MarkLogic/appservices/infostudio/info.xqy";
info:database-create(
"newDB",
2,
"Default",
"/foobar",
"Security",
"Schemas",
"Triggers")
(: Creates a new database, named "newDB," and attaches to it two forests. :)
|
|
|
|
info:database-get-feature(
|
|
$database as xs:string,
|
|
[$preview-settings as element(info:settings)],
|
|
[$delta as xs:boolean]
|
| ) as element(info:settings) |
|
 |
Summary:
This function returns the a node representing support for database features of wildcarding,
word positions, and reverse search. Returns a boolean value for each database feature
based on whether its corresponding database settings are on or off. If some settings
are on for a feature but others are off, then the feature will be noted as off.
A "detail" child node includes the value of each related database setting.
The optional $preview-settings and $delta arguments allow
developers to pass in settings to preview the result of a given set of features.
If $delta is set to true(), only values that will change
are returned. If not provided, $delta is false().
This call is read-only, it does not change the state of database features supported.
|
Parameters:
$database
:
The name of the database for which to get support information. If a database that comes
pre-configured with the server (other than the "Documents" database) is specified,
then a "Restricted Database" exception will occur.
|
$preview-settings
(optional):
Settings XML representing a desired set of database features to preview. Note: if the
incoming XML has a detail section, it is ignored.
|
$delta
(optional):
If this parameter is set to true, then on preview the returned information will only
include settings that would change on a call to info:database-set-feature().
Defaults to false if not specified.
|
|
Example:
xquery version "1.0-ml";
import module namespace info = "http://marklogic.com/appservices/infostudio"
at "/MarkLogic/appservices/infostudio/info.xqy";
info:database-get-feature("Documents")
(: Returns the current state of the supported database features. :)
|
|
|
|
info:database-set-feature(
|
|
$database as xs:string,
|
|
$settings as element(info:settings)
|
| ) as empty-sequence() |
|
 |
Summary:
This function adds or removes the related database settings for wildcarding, word positions,
and/or reverse search. Not specifying a feature will leave it in its current state.
|
Parameters:
$database
:
The name of the database to add or remove support of specified database feature. If a
database that comes pre-configured with the server (other than the "Documents" database)
is specified, then a "Restricted Database" exception will occur.
|
$settings
:
Settings XML representing desired database features to configure. Valid options are
"wildcard", "position", "reverse". If an element is not specified, its setting remains
unchanged. Note: if the incoming XML has a detail section (from a verbose call to
get-feature) it is ignored.
|
|
Example:
xquery version "1.0-ml";
import module namespace info = "http://marklogic.com/appservices/infostudio"
at "/MarkLogic/appservices/infostudio/info.xqy";
info:database-set-feature("Documents",
<settings xmlns="http://marklogic.com/appservices/infostudio">
<wildcard>true</wildcard>
<position>true></position>
<reverse>false</reverse>
</settings> )
(: Turn on 3 character wildcard, the codepoint word lexicon, word positions,
and 3 character word position. It will turn off reverse search. :)
|
|
|
|
info:load(
|
|
$dir-path as xs:string,
|
|
[$policy-name as xs:string?],
|
|
[$policy-deltas as element(info:options)?],
|
|
[$database as xs:string]
|
| ) as xs:string |
|
 |
Summary:
This function does a one-time scan of the named directory path (local filesystem only), and
attempts to load the files, spawning multiple transactions if necessary. This collector
should be considered stateless; although some lightweight state information is passed
via an external variable to the executing module, it is not persistent. Transactions
are asynchronous, and order of insertions is not guaranteed.
This function returns a ticket URI that can be used to access status information for that ticket.
|
Parameters:
$dir-path
:
Local filesystem path of a set of documents to load.
|
$policy-name
(optional):
The name of a stored ingestion policy. If the name is provided but does not exist,
an error is thrown. If no name is provided, a stored default policy is used if
available. If neither exists, reasonable global defaults are used.
|
$policy-deltas
(optional):
An options node with a namespace of http://marklogic.com/appservices/infostudio.
If it is provided, it is merged with the stored policy, providing
the ability to override or supplement stored policy at runtime. See the description
of the info:policy-set function for an example options node.
|
$database
(optional):
Name of a database into which content should be inserted. If not provided,
defaults to the current context database.
|
|
Usage Notes:
All documents loaded with info:load are added to a
collection with the URI corresponding to the ticket ID
returned from the function. For example, if info:load
returns /tickets/ticket/123456, then any documents loaded
have the collection /tickets/ticket/123456 (in
addition to any collections added via the options
node or options delta).
|
Example:
xquery version "1.0-ml";
import module namespace info = "http://marklogic.com/appservices/infostudio"
at "/MarkLogic/appservices/infostudio/info.xqy";
info:load("C:\docs\mydocs", (), (), "testDB")
(: Loads the contents of the C:\docs\mydocs directory into the testBD database using
the default policy. :)
|
Example:
xquery version "1.0-ml";
import module namespace info = "http://marklogic.com/appservices/infostudio"
at "/MarkLogic/appservices/infostudio/info.xqy";
let $delta :=
<options xmlns="http://marklogic.com/appservices/infostudio">
<uri>
<literal>http://mydir/</literal>
<filename/>
<literal>.</literal>
<ext/>
</uri>
</options>
return info:load("C:\docs\mydocs", (), $delta, "testDB")
(: Loads the contents of the C:\docs\mydocs directory into the testBD database at the
URI http://mydir/, using the rest of the options specified by the default policy.
For example, C:\docs\mydocs\mydoc.xml will be loaded into the database with the
URI http://mydir/mydoc.xml. :)
|
|
|
|
info:ticket-errors(
|
|
$ticket-id as xs:string,
|
|
[$start as xs:unsignedInt?],
|
|
[$page-length as xs:unsignedInt?],
|
|
[$sort-ascending as xs:boolean?],
|
|
[$filter as schema-element(cts:query)?]
|
| ) as element(info:errors) |
|
 |
Summary:
This function returns any errors that may have occured when loading content.
The load operation must be complete before any errors appear in the ticket.
You can use the
optional parameters, start and page-length, to paginate through a
long list of errors.
By default, errors are sorted by descending time. You can set the sort-ascending
parameter to true to return errors in ascending time, which can be useful when
paginating on an open ticket where new errors are coming in constantly.
The filter parameter allows you to annotate errors with metadata.
You can create a filter to limit results by anything in the ticket, such as time,
some custom annotation, or error code.
|
Parameters:
$ticket-id
:
The id of the ticket.
|
$start
(optional):
Which error in a list from which to begin the returned list. For example, if dealing with
hundreds of errors, you might want to display them in increments of 50. So you would
call this function with start set to 1, then 50, then 100, and so on.
|
$page-length
(optional):
The number of errors returned in each page. In the example described for the
start parameter, this would be set to 50.
|
$sort-ascending
(optional):
By default, errors are sorted by descending time. Set to true to
return errors in ascending time.
|
$filter
(optional):
Any customer query written to filter the list of errors.
|
|
Example:
xquery version "1.0-ml";
import module namespace info = "http://marklogic.com/appservices/infostudio"
at "/MarkLogic/appservices/infostudio/info.xqy";
info:ticket-errors("/tickets/ticket/8850539794189994434")
(: Returns any errors associated with the specified ticket. :)
|
|
|
|
info:tickets(
|
|
[$database as xs:string*],
|
|
[$status as xs:string*],
|
|
[$custom-query as schema-element(cts:query)?]
|
| ) as xs:string* |
|
 |
Summary:
This function returns a sequence of ticket IDs, optionally narrowed by database name.
|
Parameters:
$database
(optional):
A database name to narrow the selection of tickets to those associated with that database.
|
$status
(optional):
A status name to narrow the selection of tickets to those with the
specified status.
The valid status values are "aborted", "active", "cancelled",
"cleared", "completed", "inactive", "unloading", "unloaded", and
"unload-aborted".
|
$custom-query
(optional):
Some custom query to further narrow down the list of tickets returned.
|
|
Example:
xquery version "1.0-ml";
import module namespace info = "http://marklogic.com/appservices/infostudio"
at "/MarkLogic/appservices/infostudio/info.xqy";
info:tickets()
(: Returns the IDs of all of the tickets generated from loads into all of the databases. :)
|
|
|