Download OpenAPI specification:Download
Search.io offers a search and discovery service with Neuralsearch®, the world's first instant AI search technology. Businesses of all sizes use Search.io to build site search and discovery solutions that maximize e-commerce revenue, optimize on-site customer experience, and scale their online presence.
The Search.io API uses API keys to authenticate requests.
You should provide either your account's API key or your collection's API key. The type of key you provide depends on the required level of access for the request you are making. To administer your account (e.g. create and delete collections) you should provide an account key. For most other requests (e.g. query collection) you should provide a collection key.
Your API keys carry many privileges, so be sure to keep them secure. Do not share your API keys in publicly accessible areas such as GitHub, client-side code, and so forth.
Authentication to the API is performed via HTTP Basic Auth. Provide your API key ID as the basic auth username value. Provide your API key secret as the basic auth password value.
$ curl https://api.search.io -u <key_id>:<key_secret>
You can find your account's API keys in the Search.io Console account credentials page. You can find your collection's API keys in the Search.io Console collection credentials page.
All API requests must be made over HTTPS. Calls made over plain HTTP fail. API requests without authentication also fail.
For customers in Australia and New Zealand, use the https://au-api.search.io endpoint for faster routing to collections based in the au
region.
basic
The Search.io API employs a number of safeguards against bursts of incoming traffic to help maximize its stability. Users who send many requests in quick succession may see error responses that show up as HTTP status code 429
.
For the UpsertRecord call, Search.io allows up to 175 write operations per second.
Treat these limits as maximums and don't generate unnecessary load. See Handling limiting gracefully for advice on handling 429
s.
We may reduce limits to prevent abuse.
Rate limiting can occur under a variety of conditions, but it's most common in these scenarios:
N
passed to BatchUpsertRecords is counted as N
UpsertRecord calls for the purposes of rate limiting, as opposed to a single call. Treat batch API calls as a convenience rather than a way to get more write throughput.A basic technique for integrations to gracefully handle limiting is to watch for 429
HTTP status codes and build in a retry mechanism. The retry mechanism should follow an exponential backoff schedule to reduce request volume when necessary. We also recommend building some randomness into the backoff schedule to avoid a thundering herd effect.
Collections store the records that you want to search through.
They also contain the configuration associated with your data including pipelines, rules, synonyms, authorized domains and analytics. Each collection has an associated schema that designates field names, field types, and whether a field's data is indexed for text search.
Create a collection for every new set of related records that you want to search through.
Retrieve a list of collections in an account.
page_size | integer <int32> The maximum number of collections to return. The service may return fewer than this value. If unspecified, at most 50 collections are returned. The maximum value is 100; values above 100 are coerced to 100. |
page_token | string A page token, received from a previous ListCollections call. Provide this to retrieve the subsequent page. When paginating, all other parameters provided to ListCollections must match the call that provided the page token. |
view | string Default: "VIEW_UNSPECIFIED" Enum: "VIEW_UNSPECIFIED" "BASIC" "FULL" The amount of information to include in each retrieved collection.
|
Account-Id | string The account that owns this set of collections, e.g. |
{- "collections": [
- {
- "account_id": "string",
- "authorized_query_domains": [
- "string"
], - "create_time": "2019-08-24T14:15:22Z",
- "display_name": "string",
- "id": "string"
}
], - "next_page_token": "string"
}
Create an empty collection.
Before records can be added to a collection, the schema and pipelines for the collection have to be set up. Consider setting up new collections via the Search.io Console, which handles the creation of the schema and pipelines for you.
collection_id required | string The ID to use for the collection. This must start with an alphanumeric character followed by one or more
alphanumeric or |
Account-Id | string The account that owns the collection, e.g. |
Details of the collection to create.
authorized_query_domains | Array of strings The list of authorized query domains for the collection. Client-side / browser requests to the QueryCollection call can be made by any authorized query domain or any of its subdomains. This allows your interface to make search requests without having to provide an API key in the client-side request. |
display_name required | string The collection's display name. You can change this at any time. |
{- "authorized_query_domains": [
- "string"
], - "display_name": "string"
}
{- "account_id": "string",
- "authorized_query_domains": [
- "string"
], - "create_time": "2019-08-24T14:15:22Z",
- "display_name": "string",
- "id": "string"
}
Delete a collection and all of its associated data.
Note: This operation cannot be reversed.
collection_id required | string The collection to delete, e.g. |
Account-Id | string The account that owns the collection, e.g. |
null
Retrieve the details of a collection.
collection_id required | string The collection to retrieve, e.g. |
view | string Default: "VIEW_UNSPECIFIED" Enum: "VIEW_UNSPECIFIED" "BASIC" "FULL" The amount of information to include in the retrieved pipeline.
|
Account-Id | string The account that owns the collection, e.g. |
{- "account_id": "string",
- "authorized_query_domains": [
- "string"
], - "create_time": "2019-08-24T14:15:22Z",
- "display_name": "string",
- "id": "string"
}
Update the details of a collection.
collection_id required | string The collection to update, e.g. |
update_mask | string The list of fields to update, separated by a comma, e.g. Each field should be in snake case. For each field that you want to update, provide a corresponding value in the collection object containing the new value. |
Account-Id | string The account that owns the collection, e.g. |
The details of the collection to update.
authorized_query_domains | Array of strings The list of authorized query domains for the collection. Client-side / browser requests to the QueryCollection call can be made by any authorized query domain or any of its subdomains. This allows your interface to make search requests without having to provide an API key in the client-side request. |
display_name required | string The collection's display name. You can change this at any time. |
{- "authorized_query_domains": [
- "string"
], - "display_name": "string"
}
{- "account_id": "string",
- "authorized_query_domains": [
- "string"
], - "create_time": "2019-08-24T14:15:22Z",
- "display_name": "string",
- "id": "string"
}
Run a query on a collection with a hypothetical configuration to see what kinds of results it produces.
Saved promotions with a start date in the future are enabled during the experiment, unless they are explicitly disabled.
The following example demonstrates how to run a simple experiment for a string, against a pipeline and with a proposed promotion:
{
"pipeline": { "name": "my-pipeline" },
"variables": { "q": "search terms" },
"promotions": [{
"id": "1234",
"condition": "q = 'search terms'",
"pins": [{
"key": { "field": "id", "value": "54hdc7h2334h" },
"position": 1
}]
}]
}
collection_id required | string The collection to query, e.g. |
object (Pipeline) | |
object (ExperimentRequestPipeline) The pipeline to use when running the experiment. If not provided the default query pipeline is used. | |
Array of objects (Promotion) The promotions to consider active when running the search. Provided promotions override existing promotions with the same ID. | |
required | object The initial values for the variables the pipeline operates on and transforms throughout its steps. The most important variable is
To paginate through results, set the variables
To sort results, set the variable
To sort in reverse, prefix the schema field with a minus sign
|
{- "custom_pipeline": {
- "description": "string",
- "name": "string",
- "post_steps": [
- {
- "annotations": [
- "string"
], - "condition": "string",
- "description": "string",
- "id": "string",
- "params": {
- "property1": {
- "bind": "string",
- "constant": "string",
- "default_value": "string",
- "description": "string"
}, - "property2": {
- "bind": "string",
- "constant": "string",
- "default_value": "string",
- "description": "string"
}
}, - "title": "string"
}
], - "pre_steps": [
- {
- "annotations": [
- "string"
], - "condition": "string",
- "description": "string",
- "id": "string",
- "params": {
- "property1": {
- "bind": "string",
- "constant": "string",
- "default_value": "string",
- "description": "string"
}, - "property2": {
- "bind": "string",
- "constant": "string",
- "default_value": "string",
- "description": "string"
}
}, - "title": "string"
}
], - "type": "TYPE_UNSPECIFIED",
- "version": "string"
}, - "pipeline": {
- "name": "string",
- "version": "string"
}, - "promotions": [
- {
- "banners": [
- {
- "description": "string",
- "height": 0,
- "id": "string",
- "image_url": "string",
- "position": 0,
- "target_url": "string",
- "text_color": "string",
- "text_position": "TEXT_POSITION_UNSPECIFIED",
- "title": "string",
- "width": 0
}
], - "condition": "string",
- "disabled": true,
- "display_name": "string",
- "end_time": "2019-08-24T14:15:22Z",
- "exclusions": [
- {
- "key": {
- "field": "string",
- "value": "string"
}
}
], - "filter_boosts": [
- {
- "boost": 0,
- "filter": "string"
}
], - "filter_conditions": [
- {
- "filter": [
- "string"
]
}
], - "id": "string",
- "pins": [
- {
- "key": {
- "field": "string",
- "value": "string"
}, - "mode": "PIN",
- "position": 0
}
], - "range_boosts": [
- {
- "boost": 0,
- "end": 0,
- "field": "string",
- "null_boost": 0,
- "start": 0
}
], - "start_time": "2019-08-24T14:15:22Z"
}
], - "variables": {
- "property1": { },
- "property2": { }
}
}
{- "query_response": {
- "active_promotions": [
- {
- "active_exclusions": [
- {
- "key": {
- "field": "string",
- "value": "string"
}
}
], - "active_pins": [
- {
- "key": {
- "field": "string",
- "value": "string"
}, - "mode": "PIN",
- "position": 0
}
], - "promotion_id": "string"
}
], - "aggregate_filters": {
- "property1": {
- "analysis": {
- "avg_length": 0,
- "cardinality": 0,
- "coverage": 0,
- "max_length": 0,
- "min_length": 0
}, - "buckets": {
- "buckets": {
- "property1": {
- "count": 0,
- "name": "string"
}, - "property2": {
- "count": 0,
- "name": "string"
}
}
}, - "count": {
- "counts": {
- "property1": 0,
- "property2": 0
}
}, - "date": {
- "dates": {
- "property1": 0,
- "property2": 0
}
}, - "metric": {
- "value": 0
}, - "percentile": {
- "cdf": [
- {
- "point": 0,
- "value": 0
}
], - "percentiles": [
- {
- "point": 0,
- "value": 0
}
]
}
}, - "property2": {
- "analysis": {
- "avg_length": 0,
- "cardinality": 0,
- "coverage": 0,
- "max_length": 0,
- "min_length": 0
}, - "buckets": {
- "buckets": {
- "property1": {
- "count": 0,
- "name": "string"
}, - "property2": {
- "count": 0,
- "name": "string"
}
}
}, - "count": {
- "counts": {
- "property1": 0,
- "property2": 0
}
}, - "date": {
- "dates": {
- "property1": 0,
- "property2": 0
}
}, - "metric": {
- "value": 0
}, - "percentile": {
- "cdf": [
- {
- "point": 0,
- "value": 0
}
], - "percentiles": [
- {
- "point": 0,
- "value": 0
}
]
}
}
}, - "aggregates": {
- "property1": {
- "analysis": {
- "avg_length": 0,
- "cardinality": 0,
- "coverage": 0,
- "max_length": 0,
- "min_length": 0
}, - "buckets": {
- "buckets": {
- "property1": {
- "count": 0,
- "name": "string"
}, - "property2": {
- "count": 0,
- "name": "string"
}
}
}, - "count": {
- "counts": {
- "property1": 0,
- "property2": 0
}
}, - "date": {
- "dates": {
- "property1": 0,
- "property2": 0
}
}, - "metric": {
- "value": 0
}, - "percentile": {
- "cdf": [
- {
- "point": 0,
- "value": 0
}
], - "percentiles": [
- {
- "point": 0,
- "value": 0
}
]
}
}, - "property2": {
- "analysis": {
- "avg_length": 0,
- "cardinality": 0,
- "coverage": 0,
- "max_length": 0,
- "min_length": 0
}, - "buckets": {
- "buckets": {
- "property1": {
- "count": 0,
- "name": "string"
}, - "property2": {
- "count": 0,
- "name": "string"
}
}
}, - "count": {
- "counts": {
- "property1": 0,
- "property2": 0
}
}, - "date": {
- "dates": {
- "property1": 0,
- "property2": 0
}
}, - "metric": {
- "value": 0
}, - "percentile": {
- "cdf": [
- {
- "point": 0,
- "value": 0
}
], - "percentiles": [
- {
- "point": 0,
- "value": 0
}
]
}
}
}, - "banners": [
- {
- "description": "string",
- "height": 0,
- "id": "string",
- "image_url": "string",
- "position": 0,
- "target_url": "string",
- "text_color": "string",
- "text_position": "TEXT_POSITION_UNSPECIFIED",
- "title": "string",
- "width": 0
}
], - "feature_score_weight": 0,
- "pipeline": {
- "name": "string",
- "version": "string"
}, - "processing_duration": "string",
- "query_id": "string",
- "redirects": {
- "property1": {
- "id": "string",
- "target": "string",
- "token": "string"
}, - "property2": {
- "id": "string",
- "target": "string",
- "token": "string"
}
}, - "results": [
- {
- "banner": {
- "description": "string",
- "height": 0,
- "id": "string",
- "image_url": "string",
- "position": 0,
- "target_url": "string",
- "text_color": "string",
- "text_position": "TEXT_POSITION_UNSPECIFIED",
- "title": "string",
- "width": 0
}, - "feature_score": 0,
- "index_score": 0,
- "neural_score": 0,
- "record": { },
- "relevance_score": 0,
- "score": 0,
- "token": {
- "click": {
- "token": "string"
}, - "pos_neg": {
- "neg": "string",
- "pos": "string"
}
}
}
], - "total_size": "string",
- "variables": {
- "property1": { },
- "property2": { }
}
}
}
Query the collection to search for records.
The following example demonstrates how to run a simple search for a particular string:
{
"variables": { "q": "search terms" }
}
For more information:
Note: Unlike other API calls, the QueryCollection
call can be called
from a browser. When called from a browser, the Account-Id
header must
be set to your account ID.
collection_id required | string The collection to query, e.g. |
Account-Id | string The account that owns the collection, e.g. Unlike other API calls, the |
object (QueryCollectionRequestPipeline) The pipeline to use when querying the collection. If not provided the default query pipeline is used. | |
object (QueryCollectionRequestTracking) | |
required | object The initial values for the variables the pipeline operates on and transforms throughout its steps. The most important variable is
To paginate through results, set the variables
To sort results, set the variable
To sort in reverse, prefix the schema field with a minus sign
|
{- "pipeline": {
- "name": "string",
- "version": "string"
}, - "tracking": {
- "data": {
- "property1": "string",
- "property2": "string"
}, - "field": "string",
- "query_id": "string",
- "sequence": 0,
- "type": "TYPE_UNSPECIFIED"
}, - "variables": {
- "property1": { },
- "property2": { }
}
}
{- "active_promotions": [
- {
- "active_exclusions": [
- {
- "key": {
- "field": "string",
- "value": "string"
}
}
], - "active_pins": [
- {
- "key": {
- "field": "string",
- "value": "string"
}, - "mode": "PIN",
- "position": 0
}
], - "promotion_id": "string"
}
], - "aggregate_filters": {
- "property1": {
- "analysis": {
- "avg_length": 0,
- "cardinality": 0,
- "coverage": 0,
- "max_length": 0,
- "min_length": 0
}, - "buckets": {
- "buckets": {
- "property1": {
- "count": 0,
- "name": "string"
}, - "property2": {
- "count": 0,
- "name": "string"
}
}
}, - "count": {
- "counts": {
- "property1": 0,
- "property2": 0
}
}, - "date": {
- "dates": {
- "property1": 0,
- "property2": 0
}
}, - "metric": {
- "value": 0
}, - "percentile": {
- "cdf": [
- {
- "point": 0,
- "value": 0
}
], - "percentiles": [
- {
- "point": 0,
- "value": 0
}
]
}
}, - "property2": {
- "analysis": {
- "avg_length": 0,
- "cardinality": 0,
- "coverage": 0,
- "max_length": 0,
- "min_length": 0
}, - "buckets": {
- "buckets": {
- "property1": {
- "count": 0,
- "name": "string"
}, - "property2": {
- "count": 0,
- "name": "string"
}
}
}, - "count": {
- "counts": {
- "property1": 0,
- "property2": 0
}
}, - "date": {
- "dates": {
- "property1": 0,
- "property2": 0
}
}, - "metric": {
- "value": 0
}, - "percentile": {
- "cdf": [
- {
- "point": 0,
- "value": 0
}
], - "percentiles": [
- {
- "point": 0,
- "value": 0
}
]
}
}
}, - "aggregates": {
- "property1": {
- "analysis": {
- "avg_length": 0,
- "cardinality": 0,
- "coverage": 0,
- "max_length": 0,
- "min_length": 0
}, - "buckets": {
- "buckets": {
- "property1": {
- "count": 0,
- "name": "string"
}, - "property2": {
- "count": 0,
- "name": "string"
}
}
}, - "count": {
- "counts": {
- "property1": 0,
- "property2": 0
}
}, - "date": {
- "dates": {
- "property1": 0,
- "property2": 0
}
}, - "metric": {
- "value": 0
}, - "percentile": {
- "cdf": [
- {
- "point": 0,
- "value": 0
}
], - "percentiles": [
- {
- "point": 0,
- "value": 0
}
]
}
}, - "property2": {
- "analysis": {
- "avg_length": 0,
- "cardinality": 0,
- "coverage": 0,
- "max_length": 0,
- "min_length": 0
}, - "buckets": {
- "buckets": {
- "property1": {
- "count": 0,
- "name": "string"
}, - "property2": {
- "count": 0,
- "name": "string"
}
}
}, - "count": {
- "counts": {
- "property1": 0,
- "property2": 0
}
}, - "date": {
- "dates": {
- "property1": 0,
- "property2": 0
}
}, - "metric": {
- "value": 0
}, - "percentile": {
- "cdf": [
- {
- "point": 0,
- "value": 0
}
], - "percentiles": [
- {
- "point": 0,
- "value": 0
}
]
}
}
}, - "banners": [
- {
- "description": "string",
- "height": 0,
- "id": "string",
- "image_url": "string",
- "position": 0,
- "target_url": "string",
- "text_color": "string",
- "text_position": "TEXT_POSITION_UNSPECIFIED",
- "title": "string",
- "width": 0
}
], - "feature_score_weight": 0,
- "pipeline": {
- "name": "string",
- "version": "string"
}, - "processing_duration": "string",
- "query_id": "string",
- "redirects": {
- "property1": {
- "id": "string",
- "target": "string",
- "token": "string"
}, - "property2": {
- "id": "string",
- "target": "string",
- "token": "string"
}
}, - "results": [
- {
- "banner": {
- "description": "string",
- "height": 0,
- "id": "string",
- "image_url": "string",
- "position": 0,
- "target_url": "string",
- "text_color": "string",
- "text_position": "TEXT_POSITION_UNSPECIFIED",
- "title": "string",
- "width": 0
}, - "feature_score": 0,
- "index_score": 0,
- "neural_score": 0,
- "record": { },
- "relevance_score": 0,
- "score": 0,
- "token": {
- "click": {
- "token": "string"
}, - "pos_neg": {
- "neg": "string",
- "pos": "string"
}
}
}
], - "total_size": "string",
- "variables": {
- "property1": { },
- "property2": { }
}
}
Query the collection to search for records.
The following example demonstrates how to run a simple search for a particular string:
{
"variables": { "q": "search terms" }
}
For more information:
Note: Unlike other API calls, the QueryCollection
call can be called
from a browser. When called from a browser, the Account-Id
header must
be set to your account ID.
collection_id required | string The collection to query, e.g. |
object (QueryCollectionRequestPipeline) The pipeline to use when querying the collection. If not provided the default query pipeline is used. | |
object (QueryCollectionRequestTracking) | |
required | object The initial values for the variables the pipeline operates on and transforms throughout its steps. The most important variable is
To paginate through results, set the variables
To sort results, set the variable
To sort in reverse, prefix the schema field with a minus sign
|
{- "pipeline": {
- "name": "string",
- "version": "string"
}, - "tracking": {
- "data": {
- "property1": "string",
- "property2": "string"
}, - "field": "string",
- "query_id": "string",
- "sequence": 0,
- "type": "TYPE_UNSPECIFIED"
}, - "variables": {
- "property1": { },
- "property2": { }
}
}
{- "active_promotions": [
- {
- "active_exclusions": [
- {
- "key": {
- "field": "string",
- "value": "string"
}
}
], - "active_pins": [
- {
- "key": {
- "field": "string",
- "value": "string"
}, - "mode": "PIN",
- "position": 0
}
], - "promotion_id": "string"
}
], - "aggregate_filters": {
- "property1": {
- "analysis": {
- "avg_length": 0,
- "cardinality": 0,
- "coverage": 0,
- "max_length": 0,
- "min_length": 0
}, - "buckets": {
- "buckets": {
- "property1": {
- "count": 0,
- "name": "string"
}, - "property2": {
- "count": 0,
- "name": "string"
}
}
}, - "count": {
- "counts": {
- "property1": 0,
- "property2": 0
}
}, - "date": {
- "dates": {
- "property1": 0,
- "property2": 0
}
}, - "metric": {
- "value": 0
}, - "percentile": {
- "cdf": [
- {
- "point": 0,
- "value": 0
}
], - "percentiles": [
- {
- "point": 0,
- "value": 0
}
]
}
}, - "property2": {
- "analysis": {
- "avg_length": 0,
- "cardinality": 0,
- "coverage": 0,
- "max_length": 0,
- "min_length": 0
}, - "buckets": {
- "buckets": {
- "property1": {
- "count": 0,
- "name": "string"
}, - "property2": {
- "count": 0,
- "name": "string"
}
}
}, - "count": {
- "counts": {
- "property1": 0,
- "property2": 0
}
}, - "date": {
- "dates": {
- "property1": 0,
- "property2": 0
}
}, - "metric": {
- "value": 0
}, - "percentile": {
- "cdf": [
- {
- "point": 0,
- "value": 0
}
], - "percentiles": [
- {
- "point": 0,
- "value": 0
}
]
}
}
}, - "aggregates": {
- "property1": {
- "analysis": {
- "avg_length": 0,
- "cardinality": 0,
- "coverage": 0,
- "max_length": 0,
- "min_length": 0
}, - "buckets": {
- "buckets": {
- "property1": {
- "count": 0,
- "name": "string"
}, - "property2": {
- "count": 0,
- "name": "string"
}
}
}, - "count": {
- "counts": {
- "property1": 0,
- "property2": 0
}
}, - "date": {
- "dates": {
- "property1": 0,
- "property2": 0
}
}, - "metric": {
- "value": 0
}, - "percentile": {
- "cdf": [
- {
- "point": 0,
- "value": 0
}
], - "percentiles": [
- {
- "point": 0,
- "value": 0
}
]
}
}, - "property2": {
- "analysis": {
- "avg_length": 0,
- "cardinality": 0,
- "coverage": 0,
- "max_length": 0,
- "min_length": 0
}, - "buckets": {
- "buckets": {
- "property1": {
- "count": 0,
- "name": "string"
}, - "property2": {
- "count": 0,
- "name": "string"
}
}
}, - "count": {
- "counts": {
- "property1": 0,
- "property2": 0
}
}, - "date": {
- "dates": {
- "property1": 0,
- "property2": 0
}
}, - "metric": {
- "value": 0
}, - "percentile": {
- "cdf": [
- {
- "point": 0,
- "value": 0
}
], - "percentiles": [
- {
- "point": 0,
- "value": 0
}
]
}
}
}, - "banners": [
- {
- "description": "string",
- "height": 0,
- "id": "string",
- "image_url": "string",
- "position": 0,
- "target_url": "string",
- "text_color": "string",
- "text_position": "TEXT_POSITION_UNSPECIFIED",
- "title": "string",
- "width": 0
}
], - "feature_score_weight": 0,
- "pipeline": {
- "name": "string",
- "version": "string"
}, - "processing_duration": "string",
- "query_id": "string",
- "redirects": {
- "property1": {
- "id": "string",
- "target": "string",
- "token": "string"
}, - "property2": {
- "id": "string",
- "target": "string",
- "token": "string"
}
}, - "results": [
- {
- "banner": {
- "description": "string",
- "height": 0,
- "id": "string",
- "image_url": "string",
- "position": 0,
- "target_url": "string",
- "text_color": "string",
- "text_position": "TEXT_POSITION_UNSPECIFIED",
- "title": "string",
- "width": 0
}, - "feature_score": 0,
- "index_score": 0,
- "neural_score": 0,
- "record": { },
- "relevance_score": 0,
- "score": 0,
- "token": {
- "click": {
- "token": "string"
}, - "pos_neg": {
- "neg": "string",
- "pos": "string"
}
}
}
], - "total_size": "string",
- "variables": {
- "property1": { },
- "property2": { }
}
}
Track an analytics event when a user interacts with an object returned by a QueryCollection request.
An analytics event can be tracked for the following objects:
When tracking redirect events, set type
to redirect
.
Account-Id
header.result_id
, banner_id
or redirect_id
are required.collection_id required | string The collection to track the event against, e.g. |
Account-Id required | string The account that owns the collection, e.g. |
The details of the event to track.
banner_id | string The identifier of the promotion banner the event is about. |
object An object made up of field-value pairs that contains additional metadata to record with the event. | |
query_id required | string The query identifier. |
redirect_id | string The identifier of the redirect the event is about. |
result_id | string The identifier of the result the event is about. |
type required | string The type of event, e.g. |
{- "banner_id": "string",
- "metadata": {
- "property1": { },
- "property2": { }
}, - "query_id": "string",
- "redirect_id": "string",
- "result_id": "string",
- "type": "string"
}
{ }
In Search.io, you configure your search algorithm using pipelines.
Pipelines are easily configurable YAML-based scripts that define a series of steps that are executed sequentially when indexing a record, using a record pipeline, or performing a query, using a query pipeline.
Retrieve a list of pipelines in a collection.
collection_id required | string The collection that owns this set of pipelines, e.g. |
page_size | integer <int32> The maximum number of pipelines to return. The service may return fewer than this value. If unspecified, at most 50 pipelines are returned. The maximum value is 1000; values above 1000 are coerced to 1000. |
page_token | string A page token, received from a previous ListPipelines call. Provide this to retrieve the subsequent page. When paginating, all other parameters provided to ListPipelines must match the call that provided the page token. |
view | string Default: "VIEW_UNSPECIFIED" Enum: "VIEW_UNSPECIFIED" "BASIC" "FULL" The amount of information to include in each retrieved pipeline.
|
Account-Id | string The account that owns the collection, e.g. |
{- "next_page_token": "string",
- "pipelines": [
- {
- "collection_default": true,
- "create_time": "2019-08-24T14:15:22Z",
- "default_version": true,
- "description": "string",
- "name": "string",
- "post_steps": [
- {
- "annotations": [
- "string"
], - "condition": "string",
- "description": "string",
- "id": "string",
- "params": {
- "property1": {
- "bind": "string",
- "constant": "string",
- "default_value": "string",
- "description": "string"
}, - "property2": {
- "bind": "string",
- "constant": "string",
- "default_value": "string",
- "description": "string"
}
}, - "title": "string"
}
], - "pre_steps": [
- {
- "annotations": [
- "string"
], - "condition": "string",
- "description": "string",
- "id": "string",
- "params": {
- "property1": {
- "bind": "string",
- "constant": "string",
- "default_value": "string",
- "description": "string"
}, - "property2": {
- "bind": "string",
- "constant": "string",
- "default_value": "string",
- "description": "string"
}
}, - "title": "string"
}
], - "type": "TYPE_UNSPECIFIED",
- "version": "string"
}
]
}
Create a new pipeline.
Pipelines are immutable once created. If you want to change a pipeline e.g. to add or change some steps, you need to create a new version of that pipeline.
To start using a new pipeline you need to update your record ingestion calls and/or your query calls to specify the new pipeline.
To create the pipeline from YAML, set the request's Content-Type
header
to application/yaml
and submit the pipeline's YAML in the request body.
collection_id required | string The collection to create the pipeline in, e.g. |
Account-Id | string The account that owns the collection, e.g. |
The pipeline to create.
description | string Description of the pipeline. |
name required | string The pipeline's name. Must start with an alphanumeric character followed by one or more
alphanumeric, |
Array of objects (PipelineStep) The post-steps that are run after an indexing operation or query request has been sent to the search index. For indexing operations, the post-steps only run when creating new records. They do not run when updating records. For querying, the post-steps have access to the result-set. This makes it possible to act on the results before sending them back to the caller. | |
Array of objects (PipelineStep) The pre-steps that are run before an indexing operation or query request is sent to the search index. | |
type required | string (PipelineType) Default: "TYPE_UNSPECIFIED" Enum: "TYPE_UNSPECIFIED" "RECORD" "QUERY"
|
version required | string The pipeline's version. Must start with an alphanumeric character followed by one or more
alphanumeric, |
{- "description": "string",
- "name": "string",
- "post_steps": [
- {
- "annotations": [
- "string"
], - "condition": "string",
- "description": "string",
- "id": "string",
- "params": {
- "property1": {
- "bind": "string",
- "constant": "string",
- "default_value": "string",
- "description": "string"
}, - "property2": {
- "bind": "string",
- "constant": "string",
- "default_value": "string",
- "description": "string"
}
}, - "title": "string"
}
], - "pre_steps": [
- {
- "annotations": [
- "string"
], - "condition": "string",
- "description": "string",
- "id": "string",
- "params": {
- "property1": {
- "bind": "string",
- "constant": "string",
- "default_value": "string",
- "description": "string"
}, - "property2": {
- "bind": "string",
- "constant": "string",
- "default_value": "string",
- "description": "string"
}
}, - "title": "string"
}
], - "type": "TYPE_UNSPECIFIED",
- "version": "string"
}
{- "collection_default": true,
- "create_time": "2019-08-24T14:15:22Z",
- "default_version": true,
- "description": "string",
- "name": "string",
- "post_steps": [
- {
- "annotations": [
- "string"
], - "condition": "string",
- "description": "string",
- "id": "string",
- "params": {
- "property1": {
- "bind": "string",
- "constant": "string",
- "default_value": "string",
- "description": "string"
}, - "property2": {
- "bind": "string",
- "constant": "string",
- "default_value": "string",
- "description": "string"
}
}, - "title": "string"
}
], - "pre_steps": [
- {
- "annotations": [
- "string"
], - "condition": "string",
- "description": "string",
- "id": "string",
- "params": {
- "property1": {
- "bind": "string",
- "constant": "string",
- "default_value": "string",
- "description": "string"
}, - "property2": {
- "bind": "string",
- "constant": "string",
- "default_value": "string",
- "description": "string"
}
}, - "title": "string"
}
], - "type": "TYPE_UNSPECIFIED",
- "version": "string"
}
Retrieve the details of a pipeline. Supply the type, name and version.
To retrieve the pipeline in YAML, set the request's Accept
header to
application/yaml
.
collection_id required | string The collection that owns the pipeline, e.g. |
type required | string Enum: "TYPE_UNSPECIFIED" "RECORD" "QUERY" The type of the pipeline to retrieve. |
name required | string The name of the pipeline to retrieve, e.g. |
version required | string The version of the pipeline to retrieve, e.g. |
view | string Default: "VIEW_UNSPECIFIED" Enum: "VIEW_UNSPECIFIED" "BASIC" "FULL" The amount of information to include in the retrieved pipeline.
|
Account-Id | string The account that owns the collection, e.g. |
{- "collection_default": true,
- "create_time": "2019-08-24T14:15:22Z",
- "default_version": true,
- "description": "string",
- "name": "string",
- "post_steps": [
- {
- "annotations": [
- "string"
], - "condition": "string",
- "description": "string",
- "id": "string",
- "params": {
- "property1": {
- "bind": "string",
- "constant": "string",
- "default_value": "string",
- "description": "string"
}, - "property2": {
- "bind": "string",
- "constant": "string",
- "default_value": "string",
- "description": "string"
}
}, - "title": "string"
}
], - "pre_steps": [
- {
- "annotations": [
- "string"
], - "condition": "string",
- "description": "string",
- "id": "string",
- "params": {
- "property1": {
- "bind": "string",
- "constant": "string",
- "default_value": "string",
- "description": "string"
}, - "property2": {
- "bind": "string",
- "constant": "string",
- "default_value": "string",
- "description": "string"
}
}, - "title": "string"
}
], - "type": "TYPE_UNSPECIFIED",
- "version": "string"
}
Get the default version for a given pipeline.
The default version of a pipeline is used when a pipeline is referred to without specifying a version.
This allows you to change the pipeline version used for requests without having to change your code.
To retrieve the pipeline in YAML, set the request's Accept
header to
application/yaml
.
collection_id required | string The collection that owns the pipeline to get the default version of, e.g.
|
type required | string Enum: "TYPE_UNSPECIFIED" "RECORD" "QUERY" The type of the pipeline to get the default version of. |
name required | string The name of the pipeline to get the default version of, e.g. |
view | string Default: "VIEW_UNSPECIFIED" Enum: "VIEW_UNSPECIFIED" "BASIC" "FULL" The amount of information to include in the retrieved pipeline.
|
Account-Id | string The account that owns the collection, e.g. |
{- "collection_default": true,
- "create_time": "2019-08-24T14:15:22Z",
- "default_version": true,
- "description": "string",
- "name": "string",
- "post_steps": [
- {
- "annotations": [
- "string"
], - "condition": "string",
- "description": "string",
- "id": "string",
- "params": {
- "property1": {
- "bind": "string",
- "constant": "string",
- "default_value": "string",
- "description": "string"
}, - "property2": {
- "bind": "string",
- "constant": "string",
- "default_value": "string",
- "description": "string"
}
}, - "title": "string"
}
], - "pre_steps": [
- {
- "annotations": [
- "string"
], - "condition": "string",
- "description": "string",
- "id": "string",
- "params": {
- "property1": {
- "bind": "string",
- "constant": "string",
- "default_value": "string",
- "description": "string"
}, - "property2": {
- "bind": "string",
- "constant": "string",
- "default_value": "string",
- "description": "string"
}
}, - "title": "string"
}
], - "type": "TYPE_UNSPECIFIED",
- "version": "string"
}
Set the default version for a given pipeline.
The default version of a pipeline is used when a pipeline is referred to without specifying a version.
This allows you to change the pipeline version used for requests without having to change your code.
collection_id required | string The collection that owns the pipeline to set the default version of, e.g.
|
type required | string Enum: "TYPE_UNSPECIFIED" "RECORD" "QUERY" The type of the pipeline to set the default version of. |
name required | string The name of the pipeline to set the default version of, e.g. |
version required | string The version to use as a default for this pipeline, e.g. |
{- "version": "string"
}
{ }
Generate basic record, query and autocomplete pipeline templates. Use these templates as a starting point for your collection's pipelines.
This call returns a set of pipelines that you can pass directly to the create pipeline call.
The generated templates can be returned in JSON, the default, or YAML. To
return the generated pipelines in YAML, set the request's Accept
header
to application/yaml
. The three pipelines in the YAML response are
separated by three dashes (---
).
collection_id required | string The collection, e.g. |
Account-Id | string The account that owns the collection, e.g. |
query_training_fields | Array of strings A list of fields to train query suggestions from. |
searchable_fields required | Array of strings A prioritized list of fields to search. |
{- "query_training_fields": [
- "string"
], - "searchable_fields": [
- "string"
]
}
{- "autocomplete_pipeline": {
- "collection_default": true,
- "create_time": "2019-08-24T14:15:22Z",
- "default_version": true,
- "description": "string",
- "name": "string",
- "post_steps": [
- {
- "annotations": [
- "string"
], - "condition": "string",
- "description": "string",
- "id": "string",
- "params": {
- "property1": {
- "bind": "string",
- "constant": "string",
- "default_value": "string",
- "description": "string"
}, - "property2": {
- "bind": "string",
- "constant": "string",
- "default_value": "string",
- "description": "string"
}
}, - "title": "string"
}
], - "pre_steps": [
- {
- "annotations": [
- "string"
], - "condition": "string",
- "description": "string",
- "id": "string",
- "params": {
- "property1": {
- "bind": "string",
- "constant": "string",
- "default_value": "string",
- "description": "string"
}, - "property2": {
- "bind": "string",
- "constant": "string",
- "default_value": "string",
- "description": "string"
}
}, - "title": "string"
}
], - "type": "TYPE_UNSPECIFIED",
- "version": "string"
}, - "query_pipeline": {
- "collection_default": true,
- "create_time": "2019-08-24T14:15:22Z",
- "default_version": true,
- "description": "string",
- "name": "string",
- "post_steps": [
- {
- "annotations": [
- "string"
], - "condition": "string",
- "description": "string",
- "id": "string",
- "params": {
- "property1": {
- "bind": "string",
- "constant": "string",
- "default_value": "string",
- "description": "string"
}, - "property2": {
- "bind": "string",
- "constant": "string",
- "default_value": "string",
- "description": "string"
}
}, - "title": "string"
}
], - "pre_steps": [
- {
- "annotations": [
- "string"
], - "condition": "string",
- "description": "string",
- "id": "string",
- "params": {
- "property1": {
- "bind": "string",
- "constant": "string",
- "default_value": "string",
- "description": "string"
}, - "property2": {
- "bind": "string",
- "constant": "string",
- "default_value": "string",
- "description": "string"
}
}, - "title": "string"
}
], - "type": "TYPE_UNSPECIFIED",
- "version": "string"
}, - "record_pipeline": {
- "collection_default": true,
- "create_time": "2019-08-24T14:15:22Z",
- "default_version": true,
- "description": "string",
- "name": "string",
- "post_steps": [
- {
- "annotations": [
- "string"
], - "condition": "string",
- "description": "string",
- "id": "string",
- "params": {
- "property1": {
- "bind": "string",
- "constant": "string",
- "default_value": "string",
- "description": "string"
}, - "property2": {
- "bind": "string",
- "constant": "string",
- "default_value": "string",
- "description": "string"
}
}, - "title": "string"
}
], - "pre_steps": [
- {
- "annotations": [
- "string"
], - "condition": "string",
- "description": "string",
- "id": "string",
- "params": {
- "property1": {
- "bind": "string",
- "constant": "string",
- "default_value": "string",
- "description": "string"
}, - "property2": {
- "bind": "string",
- "constant": "string",
- "default_value": "string",
- "description": "string"
}
}, - "title": "string"
}
], - "type": "TYPE_UNSPECIFIED",
- "version": "string"
}
}
Get the default pipeline for a collection.
Every collection has a default record pipeline and a default query pipeline.
When a pipeline is required to complete an operation, it can be omitted from the request if a default pipeline has been set. When adding a record to a collection, the default record pipeline is used if none is provided. When querying a collection, the default query pipeline is used if none is provided.
collection_id required | string The collection to get the default query pipeline of, e.g. |
type required | string Default: "TYPE_UNSPECIFIED" Enum: "TYPE_UNSPECIFIED" "RECORD" "QUERY" The type of the pipeline to get.
|
{- "pipeline": "string"
}
Set the default pipeline for a collection.
Every collection has a default record pipeline and a default query pipeline.
When a pipeline is required to complete an operation, it can be omitted from the request if a default pipeline has been set. When adding a record to a collection, the default record pipeline is used if none is provided. When querying a collection, the default query pipeline is used if none is provided.
Once a default pipeline has been set it cannot be cleared, only set to another pipeline.
collection_id required | string The collection to set the default query pipeline of, e.g. |
pipeline required | string The name of the pipeline to use when not otherwise specified. |
type required | string (PipelineType) Default: "TYPE_UNSPECIFIED" Enum: "TYPE_UNSPECIFIED" "RECORD" "QUERY"
|
{- "pipeline": "string",
- "type": "TYPE_UNSPECIFIED"
}
{ }
A schema describes the set of fields that records in a collection can have.
It is made up of a list of schema fields. Each schema field has a name, associated data type and mode.
For example, the following record:
{
"id": "54hdc7h2334h",
"name": "Smart TV",
"price": 1999,
"brand": "Acme",
"in_stock": true,
"tags": ["TV", "Smart TV"],
"create_time": "2006-01-02T15:04:05Z07:00"
}
Requires the following schema fields:
id
, of type STRING and mode UNIQUEname
, of type STRINGprice
, of type FLOATbrand
, of type STRINGin_stock
, of type BOOLEANtags
, of type array of STRINGcreate_time
, of type TIMESTAMPType can be one of the following:
Mode can be one of the following:
Retrieve a list of schema fields in a collection.
collection_id required | string The collection that owns this set of schema fields, e.g. |
page_size | integer <int32> The maximum number of schema fields to return. The service may return fewer than this value. If unspecified, at most 50 schema fields are returned. The maximum value is 1000; values above 1000 are coerced to 1000. |
page_token | string A page token, received from a previous ListSchemaFields call. Provide this to retrieve the subsequent page. When paginating, all other parameters provided to ListSchemaFields must match the call that provided the page token. |
Account-Id | string The account that owns the collection, e.g. |
{- "next_page_token": "string",
- "schema_fields": [
- {
- "array": true,
- "array_length": 0,
- "description": "string",
- "mode": "MODE_UNSPECIFIED",
- "name": "string",
- "type": "TYPE_UNSPECIFIED"
}
], - "total_size": 0
}
Create a new field in a collection's schema.
collection_id required | string The collection to create a schema field in, e.g. |
Account-Id | string The account that owns the collection, e.g. |
The schema field to create.
array | boolean Array indicates if the field is an array of values. For example, if |
array_length | integer <int32> The required length of the array, if This allows you to enforce that an array contains an exact number of items. For example, to store a 2x2 vector, you could set |
description | string The description of the field. |
mode | string (SchemaFieldMode) Default: "MODE_UNSPECIFIED" Enum: "MODE_UNSPECIFIED" "NULLABLE" "REQUIRED" "UNIQUE" Mode is an enumeration of modes for a field. Mode is required and cannot be unspecified.
|
name | string The name of the field. |
type | string (SchemaFieldType) Default: "TYPE_UNSPECIFIED" Enum: "TYPE_UNSPECIFIED" "STRING" "INTEGER" "FLOAT" "DOUBLE" "BOOLEAN" "TIMESTAMP" "BYTES" Type represents the underlying data type of the field. Type is required and cannot be unspecified.
|
{- "array": true,
- "array_length": 0,
- "description": "string",
- "mode": "MODE_UNSPECIFIED",
- "name": "string",
- "type": "TYPE_UNSPECIFIED"
}
{- "array": true,
- "array_length": 0,
- "description": "string",
- "mode": "MODE_UNSPECIFIED",
- "name": "string",
- "type": "TYPE_UNSPECIFIED"
}
Deleting a schema field removes it from all records within the collection, however, references to the schema field in pipelines are not removed.
Note: This operation cannot be reversed.
collection_id required | string The collection the schema field belongs to, e.g. |
schema_field_name required | string The name of the schema field to delete. |
Account-Id | string The account that owns the collection, e.g. |
null
Update the details of a schema field.
Only name
and description
can be updated.
collection_id required | string The collection the schema field belongs to, e.g. |
schema_field_name required | string The name of the schema field to update. |
update_mask | string The list of fields to update, separated by a comma, e.g. Each field should be in snake case. For each field that you want to update, provide a corresponding value in the schema field object containing the new value. |
Account-Id | string The account that owns the collection, e.g. |
The schema field details to update.
array | boolean Array indicates if the field is an array of values. For example, if |
array_length | integer <int32> The required length of the array, if This allows you to enforce that an array contains an exact number of items. For example, to store a 2x2 vector, you could set |
description | string The description of the field. |
mode | string (SchemaFieldMode) Default: "MODE_UNSPECIFIED" Enum: "MODE_UNSPECIFIED" "NULLABLE" "REQUIRED" "UNIQUE" Mode is an enumeration of modes for a field. Mode is required and cannot be unspecified.
|
name | string The name of the field. |
type | string (SchemaFieldType) Default: "TYPE_UNSPECIFIED" Enum: "TYPE_UNSPECIFIED" "STRING" "INTEGER" "FLOAT" "DOUBLE" "BOOLEAN" "TIMESTAMP" "BYTES" Type represents the underlying data type of the field. Type is required and cannot be unspecified.
|
{- "array": true,
- "array_length": 0,
- "description": "string",
- "mode": "MODE_UNSPECIFIED",
- "name": "string",
- "type": "TYPE_UNSPECIFIED"
}
{- "array": true,
- "array_length": 0,
- "description": "string",
- "mode": "MODE_UNSPECIFIED",
- "name": "string",
- "type": "TYPE_UNSPECIFIED"
}
The batch version of the CreateSchemaField call.
collection_id required | string The collection to create the schema fields in, e.g. |
Account-Id | string The account that owns the collection, e.g. |
Array of objects (SchemaField) A list of fields to create. A maximum of 1000 fields can be created in a batch. |
{- "fields": [
- {
- "array": true,
- "array_length": 0,
- "description": "string",
- "mode": "MODE_UNSPECIFIED",
- "name": "string",
- "type": "TYPE_UNSPECIFIED"
}
]
}
{- "errors": [
- {
- "index": 0,
- "status": {
- "code": 0,
- "details": [
- {
- "type_url": "string",
- "value": "string"
}
], - "message": "string"
}
}
], - "fields": [
- {
- "array": true,
- "array_length": 0,
- "description": "string",
- "mode": "MODE_UNSPECIFIED",
- "name": "string",
- "type": "TYPE_UNSPECIFIED"
}
]
}
A record is a single entry in a collection, made up of field-value pairs.
For example in the following record:
{
"name": "Kim Jones"
}
There is one field-value pair. The field is name
and the value is "Kim Jones"
.
Records are analogous to rows in a database. Records can represent:
The set of fields a record can have is known as its schema. Webpages indexed via Search.io's web crawler have a predefined schema that can be extended with custom fields. For custom records, you can define your own schema.
The batch version of the UpdateRecord call.
You cannot run batches in parallel. Your code must wait for previous calls
to BatchUpdateRecords
to complete before making subsequent calls.
A maximum of 200 records can be updated in a batch.
collection_id required | string The collection that contains the records to update, e.g. |
Account-Id | string The account that owns the collection, e.g. |
required | Array of objects (UpdateRecordRequest) The list of requests containing the records to be updated. A maximum of 200 records can be updated in a batch. |
update_mask | string The list of fields to be updated, separated by a comma, e.g.
For each field that you want to update, provide a corresponding value in each record object, within the requests list, containing the new value. If provided, and you also provide an update mask in any child request, the values must match. |
{- "requests": [
- {
- "key": {
- "field": "string",
- "value": "string"
}, - "record": {
- "property1": { },
- "property2": { }
}, - "update_mask": "string"
}
], - "update_mask": "string"
}
{- "errors": [
- {
- "index": 0,
- "status": {
- "code": 0,
- "details": [
- {
- "type_url": "string",
- "value": "string"
}
], - "message": "string"
}
}
], - "records": [
- {
- "index": 0,
- "record": { }
}
]
}
The batch version of the UpsertRecord call.
You cannot run batches in parallel. Your code must wait for previous calls
to BatchUpsertRecords
to complete before making subsequent calls.
A maximum of 200 records can be upserted in a batch.
collection_id required | string The collection to upsert the records in, e.g. |
Account-Id | string The account that owns the collection, e.g. |
object (BatchUpsertRecordsRequestPipeline) The pipeline to use when upserting the records. If not provided the default record pipeline is used. | |
records required | Array of objects A list of records to upsert. A maximum of 200 records can be upserted in a batch. |
object The initial values for the variables the pipeline operates on and transforms throughout its steps. |
{- "pipeline": {
- "name": "string",
- "version": "string"
}, - "records": [
- { }
], - "variables": {
- "property1": { },
- "property2": { }
}
}
{- "errors": [
- {
- "index": 0,
- "status": {
- "code": 0,
- "details": [
- {
- "type_url": "string",
- "value": "string"
}
], - "message": "string"
}
}
], - "keys": [
- {
- "index": 0,
- "key": {
- "field": "string",
- "value": "string"
}
}
], - "variables": [
- {
- "index": 0,
- "variables": {
- "property1": { },
- "property2": { }
}
}
]
}
Delete a record with the given key.
If you receive "service unavailable" errors, the collection may be in read
only mode. This is indicated by a COLLECTION_READ_ONLY
reason inside
the error details. The following snippet shows the JSON response for a
collection read only error.
{
"code": 14,
"message": "read only",
"details": [
{
"@type": "type.googleapis.com/google.rpc.ErrorInfo",
"reason": "COLLECTION_READ_ONLY"
}
]
}
If you encounter this error you should retry your call. Your app can use
the
Retry-After
HTTP header to know when to retry.
collection_id required | string The collection that contains the record to delete, e.g. |
Account-Id | string The account that owns the collection, e.g. |
required | object (RecordKey) |
{- "key": {
- "field": "string",
- "value": "string"
}
}
null
Retrieve a record with the given key.
collection_id required | string The collection that contains the record to retrieve, e.g. |
Account-Id | string The account that owns the collection, e.g. |
required | object (RecordKey) |
{- "key": {
- "field": "string",
- "value": "string"
}
}
{ }
Add or update specific fields within a record with the given values. The updated record is returned in the response.
To replace all fields in a record, you should use the UpsertRecord call.
Note that the update record call cannot be used to add or update indexed or unique fields. For this case use the UpsertRecord call.
If you receive "service unavailable" errors, the collection may be in read
only mode. This is indicated by a COLLECTION_READ_ONLY
reason inside
the error details. The following snippet shows the JSON response for a
collection read only error.
{
"code": 14,
"message": "read only",
"details": [
{
"@type": "type.googleapis.com/google.rpc.ErrorInfo",
"reason": "COLLECTION_READ_ONLY"
}
]
}
If you encounter this error you should retry your call. Your app can use
the
Retry-After
HTTP header to know when to retry.
collection_id required | string The collection that contains the record to update, e.g. |
Account-Id | string The account that owns the collection, e.g. |
required | object (RecordKey) |
required | object The record to update. |
update_mask required | string The list of fields to be updated, separated by a comma, e.g.
For each field that you want to update, provide a corresponding value in the record object containing the new value. |
{- "key": {
- "field": "string",
- "value": "string"
}, - "record": {
- "property1": { },
- "property2": { }
}, - "update_mask": "string"
}
{ }
If the record does not exist in the collection it is inserted. If it does exist it is updated.
If no pipeline is specified, the default record pipeline is used to process the record.
If the record is inserted, the response contains the key of the inserted record. You can use this if you need to retrieve or delete the record. If the record is updated, the response does not contain a key. Callers can use this as a signal to determine if the record is inserted/created or updated.
For example, to add a single product from your ecommerce store to a collection, use the following call:
{
"pipeline": {
"name": "my-pipeline",
"version": "1"
},
"record": {
"id": "54hdc7h2334h",
"name": "Smart TV",
"price": 1999,
"brand": "Acme",
"description": "...",
"in_stock": true
}
}
If you receive "service unavailable" errors, the collection may be in read
only mode. This is indicated by a COLLECTION_READ_ONLY
reason inside
the error details. The following snippet shows the JSON response for a
collection read only error.
{
"code": 14,
"message": "read only",
"details": [
{
"@type": "type.googleapis.com/google.rpc.ErrorInfo",
"reason": "COLLECTION_READ_ONLY"
}
]
}
If you encounter this error you should retry your call. Your app can use
the
Retry-After
HTTP header to know when to retry.
collection_id required | string The collection to upsert the record in, e.g. |
Account-Id | string The account that owns the collection, e.g. |
object (UpsertRecordRequestPipeline) The pipeline to use when upserting the record. If not provided the default record pipeline is used. | |
record required | object An object made up of field-value pairs that contains the record data. |
object The initial values for the variables the pipeline operates on and transforms throughout its steps. |
{- "pipeline": {
- "name": "string",
- "version": "string"
}, - "record": { },
- "variables": {
- "property1": { },
- "property2": { }
}
}
{- "key": {
- "field": "string",
- "value": "string"
}, - "variables": {
- "property1": { },
- "property2": { }
}
}
Retrieve a list of promotions in a collection.
Promotion pins, exclusions and filter boosts are not returned in this call.
collection_id required | string The collection that owns this set of promotions, e.g. |
page_size | integer <int32> The maximum number of promotions to return. The service may return fewer than this value. If unspecified, at most 50 promotions are returned. The maximum value is 1000; values above 1000 are coerced to 1000. |
page_token | string A page token, received from a previous ListPromotions call. Provide this to retrieve the subsequent page. When paginating, all other parameters provided to ListPromotions must match the call that provided the page token. |
view | string Default: "PROMOTION_VIEW_UNSPECIFIED" Enum: "PROMOTION_VIEW_UNSPECIFIED" "BASIC" "FULL" The amount of information to include in each retrieved promotion.
|
Account-Id | string The account that owns the collection, e.g. |
{- "next_page_token": "string",
- "promotions": [
- {
- "banners": [
- {
- "description": "string",
- "height": 0,
- "id": "string",
- "image_url": "string",
- "position": 0,
- "target_url": "string",
- "text_color": "string",
- "text_position": "TEXT_POSITION_UNSPECIFIED",
- "title": "string",
- "width": 0
}
], - "collection_id": "string",
- "condition": "string",
- "create_time": "2019-08-24T14:15:22Z",
- "disabled": true,
- "display_name": "string",
- "end_time": "2019-08-24T14:15:22Z",
- "exclusions": [
- {
- "key": {
- "field": "string",
- "value": "string"
}
}
], - "filter_boosts": [
- {
- "boost": 0,
- "filter": "string"
}
], - "filter_conditions": [
- {
- "filter": [
- "string"
]
}
], - "id": "string",
- "pins": [
- {
- "key": {
- "field": "string",
- "value": "string"
}, - "mode": "PIN",
- "position": 0
}
], - "range_boosts": [
- {
- "boost": 0,
- "end": 0,
- "field": "string",
- "null_boost": 0,
- "start": 0
}
], - "start_time": "2019-08-24T14:15:22Z",
- "update_time": "2019-08-24T14:15:22Z"
}
]
}
Create a new promotion in a collection.
collection_id required | string The collection to create a promotion in, e.g. |
Account-Id | string The account that owns the collection, e.g. |
The promotion to create.
Array of objects (Banner) The banners that are injected into the result set when the promotion is triggered. | |
condition required | string A condition expression applied to a search request that determines which searches the promotion is active for. For example, to apply the promotion's pins and boosts whenever a user
searches for 'shoes' set condition to |
disabled | boolean If disabled, the promotion is never triggered. |
display_name required | string The promotion's display name. |
end_time | string <date-time> If specified, the promotion is considered disabled after this time. |
Array of objects (PromotionExclusion) The records to exclude from search results, if the promotion is enabled. | |
Array of objects (PromotionFilterBoost) The filter boosts to apply to searches, if the promotion is enabled. | |
Array of objects (PromotionFilterCondition) The conditions applied to the filters passed from the user. A query must
match at least one of these in order to trigger the promotion. A filter
condition is comprised of a set of filters of the form For example, a query with the filter | |
id | string The promotion's ID. |
Array of objects (PromotionPin) The items to fix to specific positions in the search results. | |
Array of objects (PromotionRangeBoost) The range boosts to apply to searches, if the promotion is enabled. | |
start_time | string <date-time> If specified, the promotion is considered disabled before this time. |
{- "banners": [
- {
- "description": "string",
- "height": 0,
- "id": "string",
- "image_url": "string",
- "position": 0,
- "target_url": "string",
- "text_color": "string",
- "text_position": "TEXT_POSITION_UNSPECIFIED",
- "title": "string",
- "width": 0
}
], - "condition": "string",
- "disabled": true,
- "display_name": "string",
- "end_time": "2019-08-24T14:15:22Z",
- "exclusions": [
- {
- "key": {
- "field": "string",
- "value": "string"
}
}
], - "filter_boosts": [
- {
- "boost": 0,
- "filter": "string"
}
], - "filter_conditions": [
- {
- "filter": [
- "string"
]
}
], - "id": "string",
- "pins": [
- {
- "key": {
- "field": "string",
- "value": "string"
}, - "mode": "PIN",
- "position": 0
}
], - "range_boosts": [
- {
- "boost": 0,
- "end": 0,
- "field": "string",
- "null_boost": 0,
- "start": 0
}
], - "start_time": "2019-08-24T14:15:22Z"
}
{- "banners": [
- {
- "description": "string",
- "height": 0,
- "id": "string",
- "image_url": "string",
- "position": 0,
- "target_url": "string",
- "text_color": "string",
- "text_position": "TEXT_POSITION_UNSPECIFIED",
- "title": "string",
- "width": 0
}
], - "collection_id": "string",
- "condition": "string",
- "create_time": "2019-08-24T14:15:22Z",
- "disabled": true,
- "display_name": "string",
- "end_time": "2019-08-24T14:15:22Z",
- "exclusions": [
- {
- "key": {
- "field": "string",
- "value": "string"
}
}
], - "filter_boosts": [
- {
- "boost": 0,
- "filter": "string"
}
], - "filter_conditions": [
- {
- "filter": [
- "string"
]
}
], - "id": "string",
- "pins": [
- {
- "key": {
- "field": "string",
- "value": "string"
}, - "mode": "PIN",
- "position": 0
}
], - "range_boosts": [
- {
- "boost": 0,
- "end": 0,
- "field": "string",
- "null_boost": 0,
- "start": 0
}
], - "start_time": "2019-08-24T14:15:22Z",
- "update_time": "2019-08-24T14:15:22Z"
}
Delete a promotion and all of its associated data.
Note: This operation cannot be reversed.
collection_id required | string The collection the promotion belongs to, e.g. |
promotion_id required | string The promotion to delete, e.g. |
Account-Id | string The account that owns the collection, e.g. |
null
Retrieve the details of a promotion.
collection_id required | string The collection that owns the promotion, e.g. |
promotion_id required | string The promotion to retrieve, e.g. |
Account-Id | string The account that owns the collection, e.g. |
{- "banners": [
- {
- "description": "string",
- "height": 0,
- "id": "string",
- "image_url": "string",
- "position": 0,
- "target_url": "string",
- "text_color": "string",
- "text_position": "TEXT_POSITION_UNSPECIFIED",
- "title": "string",
- "width": 0
}
], - "collection_id": "string",
- "condition": "string",
- "create_time": "2019-08-24T14:15:22Z",
- "disabled": true,
- "display_name": "string",
- "end_time": "2019-08-24T14:15:22Z",
- "exclusions": [
- {
- "key": {
- "field": "string",
- "value": "string"
}
}
], - "filter_boosts": [
- {
- "boost": 0,
- "filter": "string"
}
], - "filter_conditions": [
- {
- "filter": [
- "string"
]
}
], - "id": "string",
- "pins": [
- {
- "key": {
- "field": "string",
- "value": "string"
}, - "mode": "PIN",
- "position": 0
}
], - "range_boosts": [
- {
- "boost": 0,
- "end": 0,
- "field": "string",
- "null_boost": 0,
- "start": 0
}
], - "start_time": "2019-08-24T14:15:22Z",
- "update_time": "2019-08-24T14:15:22Z"
}
Update the details of a promotion.
Pass each field that you want to update in the request body. Also specify
the name of each field that you want to update in the update_mask
in the
request URL query string. Separate multiple fields with a comma. Fields
included in the request body, but not included in the field mask are not
updated.
For example, to update the display_name
and start_time
fields, make a
PATCH
request to the URL:
/v4/collections/{collection_id}/promotions/{promotion_id}?update_mask=display_name,start_time
With the JSON body:
{
"display_name": "new value",
"start_time": "2006-01-02T15:04:05Z07:00",
"end_time": "2006-01-02T15:04:05Z07:00"
}
Note: In this example
end_time
is not updated because it is not specified in theupdate_mask
.
collection_id required | string The collection the promotion belongs to, e.g. |
promotion_id required | string The promotion to update, e.g. |
update_mask required | string The list of fields to be updated, separated by a comma, e.g.
Each field should be in snake case, e.g. For each field that you want to update, provide a corresponding value in the promotion object containing the new value. |
Account-Id | string The account that owns the collection, e.g. |
Details of the promotion to update.
Array of objects (Banner) The banners that are injected into the result set when the promotion is triggered. | |
condition required | string A condition expression applied to a search request that determines which searches the promotion is active for. For example, to apply the promotion's pins and boosts whenever a user
searches for 'shoes' set condition to |
disabled | boolean If disabled, the promotion is never triggered. |
display_name required | string The promotion's display name. |
end_time | string <date-time> If specified, the promotion is considered disabled after this time. |
Array of objects (PromotionExclusion) The records to exclude from search results, if the promotion is enabled. | |
Array of objects (PromotionFilterBoost) The filter boosts to apply to searches, if the promotion is enabled. | |
Array of objects (PromotionFilterCondition) The conditions applied to the filters passed from the user. A query must
match at least one of these in order to trigger the promotion. A filter
condition is comprised of a set of filters of the form For example, a query with the filter | |
id | string The promotion's ID. |
Array of objects (PromotionPin) The items to fix to specific positions in the search results. | |
Array of objects (PromotionRangeBoost) The range boosts to apply to searches, if the promotion is enabled. | |
start_time | string <date-time> If specified, the promotion is considered disabled before this time. |
{- "banners": [
- {
- "description": "string",
- "height": 0,
- "id": "string",
- "image_url": "string",
- "position": 0,
- "target_url": "string",
- "text_color": "string",
- "text_position": "TEXT_POSITION_UNSPECIFIED",
- "title": "string",
- "width": 0
}
], - "condition": "string",
- "disabled": true,
- "display_name": "string",
- "end_time": "2019-08-24T14:15:22Z",
- "exclusions": [
- {
- "key": {
- "field": "string",
- "value": "string"
}
}
], - "filter_boosts": [
- {
- "boost": 0,
- "filter": "string"
}
], - "filter_conditions": [
- {
- "filter": [
- "string"
]
}
], - "id": "string",
- "pins": [
- {
- "key": {
- "field": "string",
- "value": "string"
}, - "mode": "PIN",
- "position": 0
}
], - "range_boosts": [
- {
- "boost": 0,
- "end": 0,
- "field": "string",
- "null_boost": 0,
- "start": 0
}
], - "start_time": "2019-08-24T14:15:22Z"
}
{- "banners": [
- {
- "description": "string",
- "height": 0,
- "id": "string",
- "image_url": "string",
- "position": 0,
- "target_url": "string",
- "text_color": "string",
- "text_position": "TEXT_POSITION_UNSPECIFIED",
- "title": "string",
- "width": 0
}
], - "collection_id": "string",
- "condition": "string",
- "create_time": "2019-08-24T14:15:22Z",
- "disabled": true,
- "display_name": "string",
- "end_time": "2019-08-24T14:15:22Z",
- "exclusions": [
- {
- "key": {
- "field": "string",
- "value": "string"
}
}
], - "filter_boosts": [
- {
- "boost": 0,
- "filter": "string"
}
], - "filter_conditions": [
- {
- "filter": [
- "string"
]
}
], - "id": "string",
- "pins": [
- {
- "key": {
- "field": "string",
- "value": "string"
}, - "mode": "PIN",
- "position": 0
}
], - "range_boosts": [
- {
- "boost": 0,
- "end": 0,
- "field": "string",
- "null_boost": 0,
- "start": 0
}
], - "start_time": "2019-08-24T14:15:22Z",
- "update_time": "2019-08-24T14:15:22Z"
}
Websites, e-commerce stores and apps often have dedicated landing pages for important product categories, brands, or other promotional purposes.
Instead of performing a search, Search.io has the ability to redirect users to these landing pages when a query matches certain criteria.
Retrieve a list of redirects in a collection.
collection_id required | string The collection that owns this set of redirects, e.g. |
page_size | integer <int32> The maximum number of redirects to return. The service may return fewer than this value. If unspecified, at most 50 redirects are returned. The maximum value is 1000; values above 1000 are coerced to 1000. |
page_token | string A page token, received from a previous ListRedirects call. Provide this to retrieve the subsequent page. When paginating, all other parameters provided to ListRedirects must match the call that provided the page token. |
Account-Id | string The account that owns the collection, e.g. |
{- "next_page_token": "string",
- "redirects": [
- {
- "collection_id": "string",
- "condition": "string",
- "create_time": "2019-08-24T14:15:22Z",
- "disabled": true,
- "id": "string",
- "target": "string",
- "update_time": "2019-08-24T14:15:22Z"
}
]
}
Create a new redirect in a collection.
collection_id required | string The collection to create a redirect in, e.g. |
Account-Id | string The account that owns the collection, e.g. |
The redirect to create.
condition required | string A condition expression applied to a search request that determines whether a search is redirected. For example, to redirect if the user's query is |
disabled | boolean If disabled, the redirect is never triggered. |
target required | string The target to redirect the user to if their query matches For searches performed in a browser, target is usually a URL but it can be any value that your integration can interpret as a redirect. For example, for URLs that you need to resolve at runtime, target might be a URL template string. For apps, target might be a unique identifier used to send the user to the correct view. |
{- "condition": "string",
- "disabled": true,
- "target": "string"
}
{- "collection_id": "string",
- "condition": "string",
- "create_time": "2019-08-24T14:15:22Z",
- "disabled": true,
- "id": "string",
- "target": "string",
- "update_time": "2019-08-24T14:15:22Z"
}
Delete a redirect and all of its associated data.
Note: This operation cannot be reversed.
collection_id required | string The collection the redirect belongs to, e.g. |
redirect_id required | string The redirect to delete, e.g. |
Account-Id | string The account that owns the collection, e.g. |
null
Retrieve the details of a redirect.
collection_id required | string The collection that owns the redirect, e.g. |
redirect_id required | string The redirect to retrieve, e.g. |
Account-Id | string The account that owns the collection, e.g. |
{- "collection_id": "string",
- "condition": "string",
- "create_time": "2019-08-24T14:15:22Z",
- "disabled": true,
- "id": "string",
- "target": "string",
- "update_time": "2019-08-24T14:15:22Z"
}
Update the details of a redirect.
Pass each field that you want to update in the request body. Also specify
the name of each field that you want to update in the update_mask
in the
request URL query string. Separate multiple fields with a comma. Fields
included in the request body, but not included in the field mask are not
updated.
For example, to update the condition
field, make a PATCH
request to the
URL:
/v4/collections/{collection_id}/redirects/{redirect_id}?update_mask=condition
With the JSON body:
{
"condition": "new value",
"target": "..."
}
Note: In this example
target
is not updated because it is not specified in theupdate_mask
.
collection_id required | string The collection the redirect belongs to, e.g. |
redirect_id required | string The redirect to update, e.g. |
update_mask required | string The list of fields to be updated, separated by a comma, e.g.
Each field should be in snake case, e.g. For each field that you want to update, provide a corresponding value in the redirect object containing the new value. |
Account-Id | string The account that owns the collection, e.g. |
Details of the redirect to update.
condition required | string A condition expression applied to a search request that determines whether a search is redirected. For example, to redirect if the user's query is |
disabled | boolean If disabled, the redirect is never triggered. |
target required | string The target to redirect the user to if their query matches For searches performed in a browser, target is usually a URL but it can be any value that your integration can interpret as a redirect. For example, for URLs that you need to resolve at runtime, target might be a URL template string. For apps, target might be a unique identifier used to send the user to the correct view. |
{- "condition": "string",
- "disabled": true,
- "target": "string"
}
{- "collection_id": "string",
- "condition": "string",
- "create_time": "2019-08-24T14:15:22Z",
- "disabled": true,
- "id": "string",
- "target": "string",
- "update_time": "2019-08-24T14:15:22Z"
}
Send an event to the ranking system after a user interacts with a search result.
When querying a collection, you can set the tracking type of the query
request. When it is CLICK
or POS_NEG
, a token is generated for each
result in the query response. You can use this token to provide feedback to
the ranking system. Each time you want to record an event on a particular
search result, use the send event call and provide:
name
of the event, e.g. click
, redirect
, purchase
.token
from the search result.weight
to assign to the event, e.g. 1
.metadata
.For example, to send an event where a customer purchased a product, use the following call:
{
"name": "purchase",
"token": "eyJ...",
"weight": 1,
"metadata": {
"discount": 0.2,
"margin": 30.0,
"customer_id": "12345",
"ui_test_segment": "A"
}
}
When sending event tokens returned from redirects, set name
to
redirect
.
Note: You must pass an Account-Id
header.
Account-Id required | string The account that owns the collection, e.g. |
object An object made up of field-value pairs that contains additional metadata to record with the event. Every value in the object must be one of the following primitive types:
| |
name required | string The name of event, e.g. |
token required | string The token corresponding to the search result that was interacted with, e.g.
|
weight | integer <int32> The weight assigned to the event. Generally a sensible weight is 1. If you want to weight an event in a certain way you can use a value other than 1. For example, if you want to capture profit in an event, you could set the weight to a value that represents the profit. |
{- "metadata": {
- "property1": { },
- "property2": { }
}, - "name": "string",
- "token": "string",
- "weight": 0
}
{ }
Send an event to the ranking system after a user interacts with a search result.
When querying a collection, you can set the tracking type of the query
request. When it is CLICK
or POS_NEG
, a token is generated for each
result in the query response. You can use this token to provide feedback to
the ranking system. Each time you want to record an event on a particular
search result, use the send event call and provide:
name
of the event, e.g. click
, redirect
, purchase
.token
from the search result.weight
to assign to the event, e.g. 1
.metadata
.For example, to send an event where a customer purchased a product, use the following call:
{
"name": "purchase",
"token": "eyJ...",
"weight": 1,
"metadata": {
"discount": 0.2,
"margin": 30.0,
"customer_id": "12345",
"ui_test_segment": "A"
}
}
When sending event tokens returned from redirects, set name
to
redirect
.
Note: You must pass an Account-Id
header.
object An object made up of field-value pairs that contains additional metadata to record with the event. Every value in the object must be one of the following primitive types:
| |
name required | string The name of event, e.g. |
token required | string The token corresponding to the search result that was interacted with, e.g.
|
weight | integer <int32> The weight assigned to the event. Generally a sensible weight is 1. If you want to weight an event in a certain way you can use a value other than 1. For example, if you want to capture profit in an event, you could set the weight to a value that represents the profit. |
{- "metadata": {
- "property1": { },
- "property2": { }
}, - "name": "string",
- "token": "string",
- "weight": 0
}
{ }