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.

For more information about creating and using query profiles, see Query Manipulation.

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.

Synchronous
https://api.havenondemand.com/1/api/sync/createqueryprofile/v1
Asynchronous
https://api.havenondemand.com/1/api/async/createqueryprofile/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
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.

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 Query Profile Response {
message ( string ) Indicates that the query profile was created.
query_profile ( string ) The query profile name.
}
Model Schema
This is a JSON schema that describes the syntax of the response. See json-schema.org for a complete reference.
{
    "properties": {
        "message": {
            "type": "string"
        },
        "query_profile": {
            "type": "string"
        }
    },
    "required": [
        "query_profile",
        "message"
    ],
    "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.