Create Text Index

Creates a text index.

The Create Text Index API allows you to create a text index, which you can use to add your own content to Haven OnDemand. You specify a name for the text index, which you can use to add data, and modify the index in future operations.

Tip: You can also create and manage text indexes by using the Text Indexes Account page.

Note: Each text index flavor has a static resource unit cost, determined by the maximum index size and specialization. For more information about the resource unit costs for each flavor, see API and Resource Unit Consumption.

Quick Start

For general information about Haven OnDemand unstructured text indexing, see Text Indexes - Key Concepts. You might also like to look at our beginner and advanced how tos: Introduction to Haven OnDemand Unstructured Text Indexing and Advanced Haven OnDemand Unstructured Text Indexing.

You use the index parameter to specify the name of your index. For example:

/1/api/[sync|async]/createtextindex/v1?index=myindex

The API returns a response to confirm that your index has been created, or to highlight any errors that occurred in the process, such as an existing index having the same name.

{
  "message": "index created",
  "index": "myindex"
}

The text indexes have a number of flavors, which define the configuration of your index. The flavors influence the maximum number of documents you can index, scaling, performance, and the number of available field types. For more information about flavors, see Index Flavors.

/1/api/[sync|async]/createtextindex/v1?index=myindex&flavor=standard

After you create a text index, you can use the Add to Text Index API to add your own content to it. You can use this content in other APIs, such as Query Text Index, Find Related Concepts, and Find Similar.

Synchronous
https://api.havenondemand.com/1/api/sync/createtextindex/v1
Asynchronous
https://api.havenondemand.com/1/api/async/createtextindex/v1
Authentication

This API requires an authentication token to be supplied in the following parameter:

Parameter Description
apikey The API key to use to authenticate the API request.
Parameters

This API accepts the following parameters:

Required
Name Type Description
index
new_resource The name of the index to create.
flavor
string The configuration flavor of the text index. See Index Flavors. Default value: explorer.
Optional
Name Type Description
description
string A brief description of the index.
index_fields
array<string> Custom fields that you want to define with the Index field type. Index fields contain document content, which receives linguistic processing for keyword and conceptual search. This parameter is relevant only for Standard, Custom Fields, Explorer and Jumbo flavors. See Index Field Types.
parametric_fields
array<string> Custom fields that you want to define with the Parametric field type. Parametric fields contain values that you want to use for search filtering and exact matches. This parameter is relevant only for Standard, Categorization, Custom Fields, Explorer and Jumbo flavors. See Index Field Types.
expire_time
integer The time in minutes until a document in the index becomes eligible for automatic expiry. This parameter is relevant only for Standard, Categorization, Custom Fields, Explorer and Jumbo flavors.
expire_date_fields
array<string> Custom fields that you want to define with the Expire Date field type. Expire Date fields contain a date that you want to use to automatically expire the document. This parameter is relevant only for the Custom_Fields flavor. See Index Field Types.
numeric_fields
array<string> Custom fields that you want to define with the Numeric field type. Numeric fields contain numeric values that you want to use for searches. This parameter is relevant only for the Custom_Fields flavor. See Index Field Types.
display_name
string A friendly name for the index.

This API returns a JSON response that is described by the model below. This single model is presented both as an easy to read abstract definition and as the formal JSON schema.

Asynchronous Use

Additional requests are required to get the result if this API is invoked asynchronously.

You can use /1/job/status/<job-id> to get the status of the job, including results if the job is finished.

You can also use /1/job/result/<job-id>, which waits until the job has finished and then returns the result.

Model
This is an abstract definition of the response that describes each of the properties that might be returned.
Create Text Index Response {
index ( string , optional) The name of the new index.
message ( string , optional) Indicates that the index was created.
}
Model Schema
This is a JSON schema that describes the syntax of the response. See json-schema.org for a complete reference.
{
    "properties": {
        "index": {
            "type": "string"
        },
        "message": {
            "type": "string"
        }
    },
    "type": "object"
}


If you would like to provide us with more information then please use the box below:

We will use your submission to help improve our product.