Create Query Profile

Creates a query profile.

A query profile specifies the manipulation configuration to apply to the query criteria and corresponding results of a search against an unstructured text index. The Create Query Profile API allows you to create a query profile, which you can then use in the query_profile parameter of the Query Text Index API.

A query profile must typically reference a text index of query_manipulation flavor, which stores the actual manipulations. You can create a query_manipulation flavor text index by using the Create Text Index API.

Quick Start

Query profiles define the types of rules that you want to use to manipulate your queries.

The rule types that you can use include:

Promotions. Promotions allow you to return specific documents to include in the results of your query, or as the results of a separate promotion query. There are different types of promotions to allow you to define promotion documents manually, or to dynamically return promotions according to a query. You can also specify promotion documents that you want to insert at a specified position in the query results.

Synonyms. Synonyms allow you to modify an original query for a particular term to include other terms that you define, such that all terms marked as synonyms return the same query results. For example if you define cat as a synonym for dog, a query for dog returns the same results as a query for cat. You define synonyms as rules, which are stored in the query manipulation index.

Blacklists. Blacklists allow you to modify the original query to remove certain terms. For example, if you define dog as a blacklist term, a query for cat dog returns the same results as a query for cat.

You create and store rules in a text index with the query_manipulation flavor. For more information about how to create rules, see Query Manipulation.

You define the allowed rules in the Query Profile, by using the parameters promotions_enabled, synonyms_enabled, and blacklists_enabled. You can also optionally define categories for each type of rule, which allow you to filter a particular query profile to allow only specified rules from your query manipulation text index.

URL

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

query_profile

new_resource

The name of the query profile. The maximum length is 100 characters.

query_manipulation_index

string

The name of the query manipulation index. The maximum length is 100 characters.

Optional

Name

Type

Description

description

string

A brief description of the query profile. The maximum length is 255 characters.

promotions_enabled

boolean

Set to true to enable promotions.
Default value: false.

promotion_categories

array<string>

A list of promotion categories to enable.
Default value: [].

promotions_identified

boolean

Set to true to identify whether documents are a promotion or not. When set, documents return with an additional promotion property, which is set to true if the document is a promotion.
Default value: true.

synonyms_enabled

boolean

Set to true to enable synonyms.
Default value: false.

synonym_categories

array<string>

A list of synonym categories to enable.
Default value: [].

blacklists_enabled

boolean

Set to true to enable blacklists.
Default value: false.

blacklist_categories

array<string>

A list of blacklist categories to enable.
Default value: [].

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.

Haven OnDemand uses cookies to enhance and improve the experience it provides. By continuing to use this site or pressing Continue,
we will assume that you accept receiving all cookies. If you would like to change which cookies are set, you can change your settings.