Loading TOC...
Information Studio Developer's Guide (PDF)

Information Studio Developer's Guide — Chapter 3

Creating and Configuring Databases and REST Servers

This chapter describes how to create and configure a database in Information Studio, and how to create a REST API instance. You must have the infostudio-user role to do these tasks in Information Studio.

Accessing the Database Section of the Application Services Page

The Database section is at the top of the Application Services page. Navigate to http://localhost:8000/appservices to access the Application Services page.

The Database section provides you with access to all of the databases in your MarkLogic Server and enables you to create a new database, configure a database, or delete a database. Select a database from the Database drop-down list and click the button to the right to perform the needed action.

The Application Services Database section provides the actions described in the following table:

ActionDescription
New DatabaseCreates a new database, as described in Creating a New Database.
ConfigureConfigure a database, as described in Configuring a Database.
DeleteDelete a database, as described in Deleting a Database.

Creating a New Database

When you create a database, Information Studio creates the database and its respective forest.

To create a new database, do the following:

  1. At the top of the Application Services page, click New Database.

  1. In the New Database dialog, type the name of the new database and click Create Database:

Configuring a Database

This section describes how to configure a database and includes the following topics:

Navigating to the Database Settings Page

To open the Database Settings page, do the following:

  1. At the top of the Application Services page, select the database from the Database drop- down list:

  2. After selecting the database, click Configure:

  3. The Database Settings page appears:

Configuring Text Indexes

Information Studio provides a subset of the more common text indexing options provided by the MarkLogic Server Admin Interface.

The text indexing settings are described below. Each setting is described in detail in the Understanding the Text Index Settings section in the Administrator's Guide. These settings enable more efficient searches of the documents in your database. The cost of more efficient searches is slower loading times of the content into the database, as well as an increased use of system resources, such as memory and disk space. The Enable Indexes section of the Database Settings page looks similar to the following:

  • The Wildcards setting enables three character searches and codepoint word lexicon indexing. Use this setting for more efficient wildcard searches on the documents in your database.

An example of a wildcard search is as follows: abc*x, *abc, a?bcd. A word lexicon index maintains a list of the unique words in a database, with uniqueness determined by a specified order for sorting strings (collation).

  • The Positions setting enables word positions indexing. Use this setting for more efficient phrase searches on the documents in your database.
  • Using the Wildcard and Positions settings together enables three character word position indexing. Use this setting for better performance when wildcards are used in phrase searches on the documents in your database.
  • The Collection Lexicon setting enables collection lexicon indexing. Use this setting for more efficient searches that constrain on collections.
  • The Field Value Searches setting enables you to search against a field value using cts:field-value-query. Use this setting to enable the use of field value contraints or any queries that use cts:field-value-query.

For details on the complete set of text indexing options, see the Text Indexing chapter in the Administrator's Guide.

Configuring Database Range Indexes

MarkLogic Server maintains a set of indexes for every database to enable search applications to rapidly search the text, structure, and combinations of the text and structure in XML documents. Defining a range index on an element or attribute enables more efficient range query search operations, such as those described in the Search Page section in the Application Builder Developer's Guide. For documents that contain numeric or date information, queries may include search conditions based on inequalities (for example, price < 100.00 or date ? thisQtr).

Range indexes are described in detail in the Range Indexes and Lexicons chapter in the Administrator's Guide. The following sections describe how to create range indexes using Information Studio:

Creating an Attribute Range Index

To create an attribute range index, perform the following steps:

  1. Navigate to the Database Settings page for the database you want to index. See Navigating to the Database Settings Page.
  2. In the Range Indexes section of the Database Settings page, click Add New.

    A selection dialog appears.

  3. Click Attribute Index. The Configure Element Attribute Range Index dialog appears.

    The following table describes the sections on the Configure Element Attribute Range Index dialog.

    FieldDescription
    Data TypeThe type of attribute data. Each of the types correspond with an XQuery type.
    CollationIf the attribute data type is string, then you can specify the URI for the collation to use. Collations specify the order in which strings are sorted and how they are compared. The Unicode collation algorithm (UCA) is set by default.
    AttributeThe name of the attribute you want to index.
  4. From the Data Type drop-down list, select the data type of the attribute.
  5. Type the collation at the top of the page (if it is a string range index).
  6. In the Attribute text box, type the name of the attribute to be indexed and click Find. If content similar to that being loaded is already present in the database, elements containing the attribute appear. Select the element to be indexed.
  7. Click Done to save the index settings.
Creating an Element Range Index

An element range index accelerates queries for comparisons within a specified type. Each element range index keeps track of the values appearing in all elements with a given name, type, and collation. Element range indexes also enable you to use the cts:element-values family of lexicon APIs and to use the cts:element-range-query constructor in searches.

To create an element range index, perform the following steps:

  1. Navigate to the Database Settings page for the database you want to index. See Navigating to the Database Settings Page.
  2. In the Range Indexes section of the Database Settings page, click Add New.

    A selection dialog appears.

  3. Click Element Index. The Configure Element Range Index dialog appears.

The following table describes the sections on the Configure Element Range Index dialog.

FieldDescription
Data TypeThe type of element data. Each of the types correspond with an XQuery type.
CollationIf the element data type is string, then you can specify the URI for the collation to use. Collations specify the order in which strings are sorted and how they are compared. The Unicode collation algorithm (UCA) is set by default.
ElementThe name of the element you want to index.
  1. From the Data Type drop-down list, select the data type of the element.
  2. Type the collation at the top of the page (if it is a string range index).
  3. In the Element text box, type the name of the element to be indexed and click Find. If content similar to that being loaded is already present in the database, all of the elements that match the specified name appear.

  4. Select the element to be indexed.
  5. Click Done to save the index settings.
Creating a Field Range Index

A field range index accelerates queries for comparisons within a field of a specified type. Each field range index keeps track of the values appearing in instances of that field. Field range indexes also enable you to use the cts:field-values family of lexicon APIs and to use the cts:field-range-query constructor in searches.

To create a field range index, perform the following steps:

  1. Navigate to the Database Settings page for the database you want to index. See Navigating to the Database Settings Page.
  2. In the Range Indexes section of the Database Settings page, click Add New.

    A selection dialog appears.

  3. Click Field Index. The Configure Field Range Index dialog appears.

The following table describes the sections on the Configure Field Range Index dialog.

FieldDescription
Field SelectionThe name of the field you want to index. The field configuration must already exist in the database.
Data TypeThe type of element data. Each of the types correspond with an XQuery type.
CollationIf the element data type is string, then you can specify the URI for the collation to use. Collations specify the order in which strings are sorted and how they are compared. The Unicode collation algorithm (UCA) is set by default.
  1. From the Data Type drop-down list, select the data type of the element.
  2. Type the collation at the top of the page (if it is a string range index).
  3. In the Element text box, type the name of the element to be indexed and click Find. If content similar to that being loaded is already present in the database, all of the elements that match the specified name appear.
  4. Select the element to be indexed.
  5. Click Done to save the index settings.

Configuring Database Fields

You can group elements into fields and then formulate searches that are constrained to those fields. A field can explicitly include elements, depending on their relevance when searching the content. Searches on the included elements in a field can be further constrained by the element's attributes and attribute values.

To create fields using Information Studio, perform the following steps:

  1. Navigate to the Database Settings page for the database you want to index. See Navigating to the Database Settings Page.
  2. In the Fields section of the Database Settings page, select Add New.

    A Configure Field dialog appears.

  3. Type the Field Name and the Localname of the element to be included in the field.

  4. (Optional) Enter the element's Namespace, Attribute, and attribute Value.
  5. (Optional) To include additional elements in the field, under the Include Elements section, click Add Element and fill in the element information.

  6. The configured field appears in the Fields list.

  7. To delete an element from the field, click Delete. When finished, click Done.

For detailed information on fields, see the Fields Database Settings chapter in the Administrator's Guide. For details on creating searches that use word constraints, see Add/Modify Word Constraint section in the Application Builder Developer's Guide.

Deleting a Database

If a database is currently being used by an App Server, the Delete button is inactive. You must first change the database used by the App Server or remove the App Server before you can delete its database.

To delete a database, use the following steps:

  1. At the top of the Application Services page, select the database from the Database drop- down list:

  1. Click Delete.

    A pop-up window appears with the message 'Are you sure you'd like to delete this database?'

  2. Click OK. Both the database and its respective forest are deleted.

Creating a REST API Instance

You can use Information Studio to create a REST API instance to service the REST API and/or the Java API. A REST API instance is an HTTP App Server that is configured to run the REST API against a particular database. For more details on the REST API and the Java API, see the REST Application Developer's Guide and the Java Application Developer's Guide.

To create a REST API instance using Information Studio, perform the following steps:

  1. Navigate to the Database Settings page for the database for which you want a REST API instance. See Navigating to the Database Settings Page.
  2. Scroll down to the REST API Instance section and click Add New.
  3. Enter a name, optionally a different port, and optionally a different group for the new REST API App Server.

  4. Click Create REST API Instance.

The REST server is created. To test the REST server, click the server name in the list of REST API Instances. When you are prompted for login credentials (in a new window or tab), enter the login credentials, and you will see some basic links that you can use to test the new REST App Server.

To delete a REST API instance, click the delete button corresponding to the server you want to delete. Deleting a REST API instance will cause a MarkLogic Server resart to free up the port.

« Previous chapter
Next chapter »
Powered by MarkLogic Server 7.0-4.1 and rundmc | Terms of Use | Privacy Policy