The Capella Data API provides a RESTful interface for working with data. It enables users to perform operations such as creating, reading, updating, or deleting data directly against your cluster. It also provides passthrough access to the Couchbase Services REST APIs, which enable you to query your data with SQL+⁠+, use vector search for AI applications, and more.
The base URL for the Data API is as follows:
https://{clusterId}.data.cloud.couchbase.com
where {clusterId}
is unique to your Couchbase Capella cluster.
For details, see Get Started with the Data API.
Retrieves the specified document.
bucketName required | string The name of the bucket containing the document. |
scopeName required | string The name of the scope containing the document. |
collectionName required | string The name of the collection containing the document. |
documentKey required | string The ID of the document. |
project | Array of strings Specific fields to project from the document. |
Authorization required | string Header for authentication. |
Accept-Encoding | string Specifies the compression used for the response in HTTP content-negotiation format. |
{- "title": "Brighton",
- "name": "Brighton Palace Pier",
- "alt": null,
- "address": "Madeira Dr, Brighton BN2 1TW",
- "directions": null,
- "phone": "01273609361",
- "tollfree": null,
- "email": "info@brightonpalacepier.co.uk",
- "hours": "11am–6pm",
- "image": null,
- "price": "£2",
- "content": "The Brighton Palace Pier, commonly known as Brighton Pier or the Palace Pier, is a Grade II listed pleasure pier in Brighton, England, located in the city centre opposite the Old Steine. Established in 1899, it was the third pier to be constructed in Brighton after the Royal Suspension Chain Pier and the West Pier, but is now the only one still in operation.",
- "geo": {
- "lat": 50.815,
- "lon": -0.136944,
- "accuracy": "RANGE_INTERPOLATED"
}, - "activity": "do",
- "type": "landmark",
- "id": 10044,
- "country": "United Kingdom",
- "city": "Brighton",
- "state": null
}
Creates a document with the given ID and contents.
bucketName required | string The name of the bucket containing the document. |
scopeName required | string The name of the scope containing the document. |
collectionName required | string The name of the collection containing the document. |
documentKey required | string The ID of the document. |
Authorization required | string Header for authentication. |
Content-Encoding | string (DocumentEncoding) Enum: "identity" "snappy" The Content-Encoding of the body of the request. |
Expires | string The expiry time to set for the document, specified as a HTTP Date header or Go Duration string. |
X-CB-Flags | integer <uint32> Overrides the document flags to a custom value rather than using values based on the Content-Type header. |
X-CB-DurabilityLevel | string (DurabilityLevel) Enum: "None" "Majority" "MajorityAndPersistOnMaster" "PersistToMajority" The level of durability required for this write operation. For details, see Durability. |
The contents of the document.
{- "code": "InvalidArgument",
- "message": "The request was malformed or invalid."
}
Updates the specified document with the given contents.
bucketName required | string The name of the bucket containing the document. |
scopeName required | string The name of the scope containing the document. |
collectionName required | string The name of the collection containing the document. |
documentKey required | string The ID of the document. |
Authorization required | string Header for authentication. |
Content-Encoding | string (DocumentEncoding) Enum: "identity" "snappy" The Content-Encoding of the body of the request. |
If-Match | string The CAS of the document to check before updating. |
Expires | string The expiry time to set for the document, specified as a HTTP Date header or Go Duration string. |
X-CB-Flags | integer <uint32> Overrides the document flags to a custom value rather than using values based on the Content-Type header. |
X-CB-DurabilityLevel | string (DurabilityLevel) Enum: "None" "Majority" "MajorityAndPersistOnMaster" "PersistToMajority" The level of durability required for this write operation. For details, see Durability. |
The contents of the document.
{- "code": "InvalidArgument",
- "message": "The request was malformed or invalid."
}
Deletes the specified document.
bucketName required | string The name of the bucket containing the document. |
scopeName required | string The name of the scope containing the document. |
collectionName required | string The name of the collection containing the document. |
documentKey required | string The ID of the document. |
Authorization required | string Header for authentication. |
If-Match | string The CAS of the document to check before updating. |
X-CB-DurabilityLevel | string (DurabilityLevel) Enum: "None" "Majority" "MajorityAndPersistOnMaster" "PersistToMajority" The level of durability required for this write operation. For details, see Durability. |
{- "code": "InvalidArgument",
- "message": "The request was malformed or invalid."
}
Updates the expiry of a document. For details, see Expiration.
bucketName required | string The name of the bucket containing the document. |
scopeName required | string The name of the scope containing the document. |
collectionName required | string The name of the collection containing the document. |
documentKey required | string The ID of the document. |
Authorization required | string Header for authentication. |
Accept-Encoding | string Specifies the compression used for the response in HTTP content-negotiation format. |
expiry | string The new expiry to set for the document, specified as an ISO8601 string. |
returnContent | boolean Specifies whether the document's contents should be returned in the response. |
{- "expiry": "YYYY-MM-DDTHH:MM:SS.sssZ",
- "returnContent": true
}
{- "title": "Brighton",
- "name": "Brighton Palace Pier",
- "alt": null,
- "address": "Madeira Dr, Brighton BN2 1TW",
- "directions": null,
- "phone": "01273609361",
- "tollfree": null,
- "email": "info@brightonpalacepier.co.uk",
- "hours": "11am–6pm",
- "image": null,
- "price": "£2",
- "content": "The Brighton Palace Pier, commonly known as Brighton Pier or the Palace Pier, is a Grade II listed pleasure pier in Brighton, England, located in the city centre opposite the Old Steine. Established in 1899, it was the third pier to be constructed in Brighton after the Royal Suspension Chain Pier and the West Pier, but is now the only one still in operation.",
- "geo": {
- "lat": 50.815,
- "lon": -0.136944,
- "accuracy": "RANGE_INTERPOLATED"
}, - "activity": "do",
- "type": "landmark",
- "id": 10044,
- "country": "United Kingdom",
- "city": "Brighton",
- "state": null
}
Appends the specified contents to the end of the document.
bucketName required | string The name of the bucket containing the document. |
scopeName required | string The name of the scope containing the document. |
collectionName required | string The name of the collection containing the document. |
documentKey required | string The ID of the document. |
Authorization required | string Header for authentication. |
If-Match | string The CAS of the document to check before updating. |
X-CB-DurabilityLevel | string (DurabilityLevel) Enum: "None" "Majority" "MajorityAndPersistOnMaster" "PersistToMajority" The level of durability required for this write operation. For details, see Durability. |
{- "code": "InvalidArgument",
- "message": "The request was malformed or invalid."
}
Prepends the specified contents to the start of the document.
bucketName required | string The name of the bucket containing the document. |
scopeName required | string The name of the scope containing the document. |
collectionName required | string The name of the collection containing the document. |
documentKey required | string The ID of the document. |
Authorization required | string Header for authentication. |
If-Match | string The CAS of the document to check before updating. |
X-CB-DurabilityLevel | string (DurabilityLevel) Enum: "None" "Majority" "MajorityAndPersistOnMaster" "PersistToMajority" The level of durability required for this write operation. For details, see Durability. |
{- "code": "InvalidArgument",
- "message": "The request was malformed or invalid."
}
Increments the value of the document. The document must contain a parsable integer as its content. For details, see Counters.
If the document does not exist, sets the initial value of the document.
bucketName required | string The name of the bucket containing the document. |
scopeName required | string The name of the scope containing the document. |
collectionName required | string The name of the collection containing the document. |
documentKey required | string The ID of the document. |
Authorization required | string Header for authentication. |
Expires | string The expiry time to set for the document, specified as a HTTP Date header or Go Duration string. |
X-CB-DurabilityLevel | string (DurabilityLevel) Enum: "None" "Majority" "MajorityAndPersistOnMaster" "PersistToMajority" The level of durability required for this write operation. For details, see Durability. |
initial | integer <uint64> The value to set the document to if the document does not exist. |
delta | integer <uint64> The value to increment the document by if it exists. |
{- "initial": 10,
- "delta": 1
}
10
Decrements the value of the document. The document must contain a parsable integer as its content. For details, see Counters.
If the document does not exist, sets the initial value of the document.
bucketName required | string The name of the bucket containing the document. |
scopeName required | string The name of the scope containing the document. |
collectionName required | string The name of the collection containing the document. |
documentKey required | string The ID of the document. |
Authorization required | string Header for authentication. |
Expires | string The expiry time to set for the document, specified as a HTTP Date header or Go Duration string. |
X-CB-DurabilityLevel | string (DurabilityLevel) Enum: "None" "Majority" "MajorityAndPersistOnMaster" "PersistToMajority" The level of durability required for this write operation. For details, see Durability. |
initial | integer <uint64> The value to set the document to if the document does not exist. |
delta | integer <uint64> The value to decrement the document by if it exists. |
{- "initial": 10,
- "delta": 1
}
11
Enables you to execute a SQL++ statement. This method allows you to run SELECT queries and other DML statements, and specify query parameters.
An object specifying one or more query parameters.
args | Array of any Supplies the values for positional parameters in the statement. Applicable if the statement or prepared statement contains 1 or more positional parameters. The value is an array of JSON values, one for each positional parameter in the statement. Refer to Named Parameters and Positional Parameters for details. |
atrcollection | string Specifies the collection where the active transaction record (ATR) is stored. The collection must be present. If not specified, the ATR is stored in the default collection in the default scope in the bucket containing the first mutated document within the transaction. The value must be a string in the form |
auto_execute | boolean Default: false Specifies that prepared statements should be executed automatically as soon as they are created. This saves you from having to make two separate requests in cases where you want to prepare a statement and execute it immediately. Refer to Auto-Execute for more information. |
client_context_id | string A piece of data supplied by the client that is echoed in the response, if present. SQL++ is agnostic about the content of this parameter; it is just echoed in the response.
|
compression | string Default: "NONE" Enum: "ZIP" "RLE" "LZMA" "LZO" "NONE" Compression format to use for response data on the wire. Values are case-insensitive. |
controls | boolean Specifies if there should be a controls section returned with the request results. When set to If the request qualifies for caching, these values will also be cached in the |
creds | Array of objects In the Data API, this parameter is ignored and has no effect. |
durability_level | string Default: "majority" Enum: "" "none" "majority" "majorityAndPersistActive" "persistToMajority" The level of durability for mutations produced by the request. If the request contains a Durability is also supported for non-transactional DML statements.
In this case, the If not specified, the default durability level is |
encoded_plan | string In Couchbase Server 6.5 and later, this parameter is ignored and has no effect. It is included for compatibility with previous versions of Couchbase Server. |
encoding | string Default: "UTF-8" Desired character encoding for the query results. Only possible value is |
format | string Default: "JSON" Enum: "JSON" "XML" "CSV" "TSV" Desired format for the query results. Values are case-insensitive. |
kvtimeout | string Default: "2.5s" The approximate time to wait for a KV get operation before timing out.
This applies to statements within a transaction, and to non-transactional statements, whether If The value for this parameter is a string.
Its format includes an amount and a mandatory unit, e.g.
Specify a duration of |
max_parallelism | integer <int32> Specifies the maximum parallelism for the query. The default value is the same as the number of partitions of the index selected for the query. |
memory_quota | integer <int32> Default: 0 Specifies the maximum amount of memory the request may use, in MB. Specify This parameter enforces a ceiling on the memory used for the tracked documents required for processing a request. It does not take into account any other memory that might be used to process a request, such as the stack, the operators, or some intermediate values. Within a transaction, this setting enforces the memory quota for the transaction by tracking the delta table and the transaction log (approximately). |
metrics | boolean Default: true Specifies that metrics should be returned with query results. |
namespace | string Specifies the namespace to use.
Currently, only the |
numatrs | integer <int32> Default: 1024 Specifies the total number of active transaction records. Must be a positive integer. |
pipeline_batch | integer <int32> Controls the number of items execution operators can batch for Fetch from the KV. |
pipeline_cap | integer <int32> Maximum number of items each execution operator can buffer between various operators. |
prepared | string Required if The name of the prepared SQL++ statement to be executed. Refer to EXECUTE for examples. If both |
preserve_expiry | boolean Default: false Specifies whether documents should keep their current expiration setting when modified by a DML statement. If If Not supported for statements in a transaction. |
pretty | boolean Specifies the query results returned in pretty format. |
profile | string Enum: "off" "phases" "timings" Specifies if there should be a profile section returned with the request results. The valid values are:
If |
query_context | string Default: "default:" Specifies the namespace, bucket, and scope used to resolve partial keyspace references within the request. The query context may be a full path, containing namespace, bucket, and scope; or a relative path, containing just the bucket and scope.
Currently, only the |
readonly | boolean Default: false Controls whether a query can change a resulting recordset. If
When using GET requests, it's best to set |
scan_cap | integer <int32> Maximum buffered channel size between the indexer client and the query service for index scans. This parameter controls when to use scan backfill. Use |
scan_consistency | string Default: "not_bounded" Enum: "not_bounded" "at_plus" "request_plus" "statement_plus" Specifies the consistency guarantee or constraint for index scanning. The valid values are:
Values are case-insensitive. For multi-statement requests, the default behavior is RYOW within each request.
If you want to disable RYOW within a request, add a separate If the request contains a |
scan_vector | object Required if Specify the lower bound vector timestamp for one keyspace when using Scan vectors are built of two-element [
Scan vectors have two forms:
Note that For queries referencing multiple keyspaces, use |
scan_vectors | object Required if A map from keyspace names to scan vectors.
See The scan vectors can be Full or Sparse. |
scan_wait | string <duration> Default: "" Can be supplied with Specifies the maximum time the client is willing to wait for an index to catch up to the vector timestamp in the request. Specifies how much time the client is willing to wait for the indexer to satisfy the required Its format includes an amount and a mandatory unit, e.g.
Specify |
signature | boolean Default: true Include a header for the results schema in the response. |
sort_projection | boolean Default: false If If |
statement | string Required if Any valid SQL++ statement for a POST request, or a read-only SQL++ statement (SELECT, EXPLAIN) for a GET request. If both When specifying the request parameters as form data, the statement may not contain an unescaped semicolon ( This restriction does not apply when specifying the request parameters in JSON format. |
timeout | string <duration> Maximum time to spend on the request before timing out. The value for this parameter is a string.
Its format includes an amount and a mandatory unit, e.g.
Specify a duration of If |
txdata | object Transaction data. For internal use only. |
txid | string <UUID> Required for statements within a transaction. Transaction ID. Specifies the transaction to which a statement belongs. For use with DML statements within a transaction, rollbacks, and commits. The transaction ID should be the same as the transaction ID generated by the |
tximplicit | boolean Default: false Specifies that a DML statement is a singleton transaction. When this parameter is true, the Query service starts a transaction and executes the statement. If execution is successful, the Query service commits the transaction; otherwise the transaction is rolled back. The statement may not be part of an ongoing transaction.
If the |
txstmtnum | integer <int32> Transaction statement number. The transaction statement number must be a positive integer, and must be higher than any previous transaction statement numbers in the transaction. If the transaction statement number is lower than the transaction statement number for any previous statement, an error is generated. |
txtimeout | string <duration> Maximum time to spend on a transaction before timing out.
Only applies to Within a transaction, the request-level The value for this parameter is a string.
Its format includes an amount and a mandatory unit, e.g.
Specify a duration of The default is |
use_cbo | boolean Specifies whether the cost-based optimizer is enabled. |
use_fts | boolean Default: false Specifies that the query should use a Search index. If the query contains a If the query does not contain a Refer to Flex Indexes for more information. |
use_replica | string Default: "unset" Enum: "off" "on" "unset" Specifies whether a query can fetch data from a replica vBucket if active vBuckets are inaccessible. The possible values are:
Do not enable read from replica when you require consistent results. Only SELECT queries that are not within a transaction can read from replica. Reading from replica is only possible if the cluster uses Couchbase Server 7.6.0 or later. Note that KV range scans cannot currently be started on a replica vBucket. If a query uses sequential scan and a data node becomes unavailable, the query might return an error, even if read from replica is enabled for the request. |
$identifier* additional property | any Supplies the value for a named parameter in the statement. Applicable if the statement or prepared statement contains 1 or more named parameters. The name of this property consists of two parts:
The value of the named parameter can be any JSON value. Refer to Named Parameters and Positional Parameters for details. |
{- "args": [
- "LAX",
- 6
], - "atrcollection": "default:`travel-sample`.transaction.test",
- "auto_execute": true,
- "client_context_id": "string",
- "compression": "zip",
- "controls": true,
- "creds": [ ],
- "durability_level": "none",
- "encoded_plan": "string",
- "encoding": "UTF-8",
- "format": "XML",
- "kvtimeout": "10ms",
- "max_parallelism": 3,
- "memory_quota": 4,
- "metrics": false,
- "namespace": "default",
- "numatrs": 512,
- "pipeline_batch": 64,
- "pipeline_cap": 1024,
- "prepared": "[127.0.0.1:8091]pricy_hotel",
- "preserve_expiry": true,
- "pretty": false,
- "profile": "phases",
- "query_context": "default:travel-sample.inventory",
- "readonly": true,
- "scan_cap": 1024,
- "scan_consistency": "at_plus",
- "scan_vector": {
- "5": [
- 5409393,
- "VB5ID"
], - "19": [
- 47574574,
- "VB19ID"
]
}, - "scan_vectors": { },
- "scan_wait": "30m",
- "signature": false,
- "sort_projection": true,
- "statement": "SELECT * FROM `travel-sample`.inventory.hotel LIMIT 1",
- "timeout": "30m",
- "txdata": { },
- "txid": "d81d9b4a-b758-4f98-b007-87ba262d3a51",
- "tximplicit": true,
- "txstmtnum": 10,
- "txtimeout": "30m",
- "use_cbo": true,
- "use_fts": true,
- "use_replica": "on",
- "$identifier1": "LAX",
- "$identifier2": "LAX"
}
{- "requestID": "615e0b26-dd61-4a1a-bda9-22333193b982",
- "signature": {
- "name": "json"
}, - "results": [
- {
- "name": "Medway Youth Hostel"
}
], - "status": "success",
- "metrics": {
- "elapsedTime": "5.232754ms",
- "executionTime": "5.160022ms",
- "resultCount": 1,
- "resultSize": 30,
- "serviceLoad": 12
}
}
Enables you to execute a SQL++ statement. This method allows you to run SELECT queries, and specify query parameters.
This endpoint is intended for situations where use of the POST
method is restricted.
required | object (Request Parameters) Specify the parameters in the query URL in URL-encoded format. The format for URL-encoded parameters is consistent with the syntax for variables according to RFC 6570. |
{- "requestID": "615e0b26-dd61-4a1a-bda9-22333193b982",
- "signature": {
- "name": "json"
}, - "results": [
- {
- "name": "Medway Youth Hostel"
}
], - "status": "success",
- "metrics": {
- "elapsedTime": "5.232754ms",
- "executionTime": "5.160022ms",
- "resultCount": 1,
- "resultSize": 30,
- "serviceLoad": 12
}
}
Use the Query with SQL++ endpoints to manage primary and secondary indexes. Alternatively, you can use the Query Indexes endpoints in the Management API.
Returns the number of documents indexed in the specified Search index.
INDEX_NAME required | string The name of the Search index definition. You must use the fully qualified name for the index, which includes the bucket and scope. To view the full, scoped name for an index for use with this endpoint:
|
{- "status": "ok",
- "count": 285
}
Run a query formatted as a JSON object against the Search index definition specified in the endpoint URL.
The endpoint returns a JSON object as a response.
This endpoint is scoped and does not require a fully qualified {INDEX_NAME}
value.
BUCKET_NAME required | string The name of the bucket containing the Search index definition. |
SCOPE_NAME required | string The name of the scope containing the Search index definition. |
INDEX_NAME required | string^[A-Za-z][0-9A-Za-z_\-]*$ The name of the Search index definition. |
A JSON object to define the settings for your Search query. For more information about how to create a Search query JSON object, see Search Request JSON Properties.
query | object An object that contains the properties for one of the supported query types. For more information, see Query Object. |
knn | Array of objects An array that contains objects that describe a Vector Search query. For more information, see Knn Objects. |
ctl | object An object that contains properties for query consistency. For more information, see Ctl Object. |
size | integer Set the total number of results to return for a single page of search results. |
from | integer Set an offset value to change where pagination starts for search results. |
highlight | object Contains properties to control search result highlighting. For more information, see Highlight Objects. |
fields | Array of strings An array of strings to specify each indexed field you want to return in search results. |
facets | object Contains nested objects to define each facet you want to return with search results. For more information, see Facet Objects. |
explain | boolean Whether to create an explanation for a search result's score in search results. |
sort | Array of any Contains an array of strings or JSON objects to set how to sort search results. For more information, see Sort Object. |
includeLocations | boolean Whether to return the position of each occurrence of a search term inside a document. |
score | string Whether to include document relevancy scoring in search results. |
search_after | Array of strings Use to control pagination in search results. |
search_before | Array of strings Use to control pagination in search results. |
collections | Array of strings An array of strings that specify the collections where you want to run the query. |
{- "query": { },
- "knn": [
- { }
], - "ctl": { },
- "size": 0,
- "from": 0,
- "highlight": { },
- "fields": [
- "string"
], - "facets": { },
- "explain": true,
- "sort": [
- null
], - "includeLocations": true,
- "score": "string",
- "search_after": [
- "string"
], - "search_before": [
- "string"
], - "collections": [
- "string"
]
}
{- "status": {
- "total": 1,
- "failed": 0,
- "successful": 1
}, - "request": {
- "query": {
- "conjuncts": [
- {
- "match": "location",
- "field": "reviews.content",
- "prefix_length": 0,
- "fuzziness": 0,
- "operator": "or"
}, - {
- "match_phrase": "nice view",
- "field": "reviews.content"
}
]
}, - "size": 10,
- "from": 0,
- "highlight": {
- "style": "html",
- "fields": [
- "reviews.content"
]
}, - "fields": null,
- "facets": null,
- "explain": true,
- "sort": [
- "reviews.Ratings.Cleanliness",
- {
- "by": "field",
- "field": "reviews.Ratings.Cleanliness",
- "type": "number"
}, - "-_score",
- "-_id"
], - "includeLocations": false,
- "score": "none",
- "search_after": null,
- "search_before": null
}, - "hits": [
- {
- "index": "travel-sample.inventory.travel-test_53373d2948c55e82_4c1c5584",
- "id": "hotel_7388",
- "score": 0,
- "explanation": {
- "value": 0,
- "message": "sum of:",
- "children": [
- {
- "value": 0,
- "message": "product of:",
- "children": [
- {
- "value": 0,
- "message": "sum of:",
- "children": [
- {
- "value": 0,
- "message": "weight(reviews.content:location^1.000000 in \u0000\u0000\u0000\u0000\u0000\u0000\u0003\n), product of:",
- "children": [
- {
- "value": 0.5320504947307548,
- "message": "queryWeight(reviews.content:location^1.000000), product of:",
- "children": [
- {
- "value": 1,
- "message": "boost"
}, - {
- "value": 1.4291903588638628,
- "message": "idf(docFreq=596, maxDocs=917)"
}, - {
- "value": 0.3722740581273647,
- "message": "queryNorm"
}
]
}, - {
- "value": 0,
- "message": "fieldWeight(reviews.content:location in \u0000\u0000\u0000\u0000\u0000\u0000\u0003\n), product of:",
- "children": [
- {
- "value": 0,
- "message": "tf(termFreq(reviews.content:location)=0"
}, - {
- "value": 0,
- "message": "fieldNorm(field=reviews.content, doc=\u0000\u0000\u0000\u0000\u0000\u0000\u0003\n)"
}, - {
- "value": 1.4291903588638628,
- "message": "idf(docFreq=596, maxDocs=917)"
}
]
}
]
}
]
}, - {
- "value": 1,
- "message": "coord(1/1)"
}
]
}, - {
- "value": 0,
- "message": "sum of:",
- "children": [
- {
- "value": 0,
- "message": "weight(reviews.content:view^1.000000 in \u0000\u0000\u0000\u0000\u0000\u0000\u0003\n), product of:",
- "children": [
- {
- "value": 0.6867550119496617,
- "message": "queryWeight(reviews.content:view^1.000000), product of:",
- "children": [
- {
- "value": 1,
- "message": "boost"
}, - {
- "value": 1.8447565629585312,
- "message": "idf(docFreq=393, maxDocs=917)"
}, - {
- "value": 0.3722740581273647,
- "message": "queryNorm"
}
]
}, - {
- "value": 0,
- "message": "fieldWeight(reviews.content:view in \u0000\u0000\u0000\u0000\u0000\u0000\u0003\n), product of:",
- "children": [
- {
- "value": 0,
- "message": "tf(termFreq(reviews.content:view)=0"
}, - {
- "value": 0,
- "message": "fieldNorm(field=reviews.content, doc=\u0000\u0000\u0000\u0000\u0000\u0000\u0003\n)"
}, - {
- "value": 1.8447565629585312,
- "message": "idf(docFreq=393, maxDocs=917)"
}
]
}
]
}, - {
- "value": 0,
- "message": "weight(reviews.content:nice^1.000000 in \u0000\u0000\u0000\u0000\u0000\u0000\u0003\n), product of:",
- "children": [
- {
- "value": 0.4952674273751292,
- "message": "queryWeight(reviews.content:nice^1.000000), product of:",
- "children": [
- {
- "value": 1,
- "message": "boost"
}, - {
- "value": 1.3303839377539577,
- "message": "idf(docFreq=658, maxDocs=917)"
}, - {
- "value": 0.3722740581273647,
- "message": "queryNorm"
}
]
}, - {
- "value": 0,
- "message": "fieldWeight(reviews.content:nice in \u0000\u0000\u0000\u0000\u0000\u0000\u0003\n), product of:",
- "children": [
- {
- "value": 0,
- "message": "tf(termFreq(reviews.content:nice)=0"
}, - {
- "value": 0,
- "message": "fieldNorm(field=reviews.content, doc=\u0000\u0000\u0000\u0000\u0000\u0000\u0003\n)"
}, - {
- "value": 1.3303839377539577,
- "message": "idf(docFreq=658, maxDocs=917)"
}
]
}
]
}
]
}
]
}, - "locations": {
- "reviews.content": {
- "location": [
- {
- "pos": 312,
- "start": 1641,
- "end": 1649,
- "array_positions": [
- 4
]
}
], - "nice": [
- {
- "pos": 165,
- "start": 840,
- "end": 844,
- "array_positions": [
- 2
]
}
], - "view": [
- {
- "pos": 166,
- "start": 845,
- "end": 849,
- "array_positions": [
- 2
]
}
]
}
}, - "fragments": {
- "reviews.content": [
- "…at's her name checked us in, very friendly and knowlegeable of the area. I would stay here again get area and right at the street car stop. nice resturants in walking distance. <mark>nice</mark> <mark>view</mark> of the city o…"
]
}, - "sort": [
- "",
- "",
- "_score",
- "hotel_7388"
]
}, - "..."
], - "total_hits": 27,
- "cost": 108906,
- "max_score": 0,
- "took": 14964461,
- "facets": null
}
Use the following APIs to retrieve Search index definitions, create new Search indexes, or delete an existing Search index.
Returns all Search index definitions inside the bucket and scope specified in the endpoint URL as a JSON object.
BUCKET_NAME required | string The name of the bucket containing the Search index definition. |
SCOPE_NAME required | string The name of the scope containing the Search index definition. |
{- "status": "ok",
- "indexDefs": {
- "uuid": "23cf9530131858b8",
- "indexDefs": {
- "travel-sample.inventory.travel-hotel": {
- "type": "fulltext-index",
- "name": "travel-hotel",
- "uuid": "a04a16f178846bc4",
- "sourceType": "gocbcore",
- "sourceName": "travel-sample",
- "sourceUUID": "8f866261438f8b0d415a437552f3ae99",
- "planParams": {
- "maxPartitionsPerPIndex": 1024,
- "indexPartitions": 1
}, - "params": {
- "doc_config": {
- "docid_prefix_delim": "",
- "docid_regexp": "",
- "mode": "scope.collection.type_field",
- "type_field": "type"
}, - "mapping": {
- "analysis": { },
- "default_analyzer": "standard",
- "default_datetime_parser": "dateTimeOptional",
- "default_field": "_all",
- "default_mapping": {
- "dynamic": true,
- "enabled": false
}, - "default_type": "_default",
- "docvalues_dynamic": false,
- "index_dynamic": true,
- "store_dynamic": false,
- "type_field": "_type",
- "types": {
- "inventory.hotel": {
- "dynamic": false,
- "enabled": true,
- "properties": {
- "reviews": {
- "dynamic": false,
- "enabled": true,
- "properties": {
- "content": {
- "dynamic": false,
- "enabled": true,
- "fields": [
- {
- "docvalues": true,
- "include_in_all": true,
- "include_term_vectors": true,
- "index": true,
- "name": "content",
- "store": true,
- "type": "text"
}
]
}
}
}
}
}
}
}, - "store": {
- "indexType": "scorch",
- "segmentVersion": 15
}
}, - "sourceParams": { }
}, - "travel-sample.inventory.travel-test": {
- "type": "fulltext-index",
- "name": "travel-test",
- "uuid": "766ddce5d41a3b41",
- "sourceType": "gocbcore",
- "sourceName": "travel-sample",
- "sourceUUID": "8f866261438f8b0d415a437552f3ae99",
- "planParams": {
- "maxPartitionsPerPIndex": 1024,
- "indexPartitions": 1
}, - "params": {
- "doc_config": {
- "docid_prefix_delim": "",
- "docid_regexp": "",
- "mode": "scope.collection.type_field",
- "type_field": "type"
}, - "mapping": {
- "analysis": { },
- "default_analyzer": "standard",
- "default_datetime_parser": "dateTimeOptional",
- "default_field": "_all",
- "default_mapping": {
- "dynamic": true,
- "enabled": true
}, - "default_type": "_default",
- "docvalues_dynamic": false,
- "index_dynamic": true,
- "store_dynamic": false,
- "type_field": "_type"
}, - "store": {
- "indexType": "scorch",
- "segmentVersion": 15
}
}, - "sourceParams": { }
}
}, - "implVersion": "5.7.0"
}
}
Returns the Search index definition for the Search index specified in the endpoint URL as a JSON object.
This endpoint is scoped and does not require a fully qualified {INDEX_NAME}
value.
BUCKET_NAME required | string The name of the bucket containing the Search index definition. |
SCOPE_NAME required | string The name of the scope containing the Search index definition. |
INDEX_NAME required | string^[A-Za-z][0-9A-Za-z_\-]*$ The name of the Search index definition. |
{- "status": "ok",
- "indexDef": {
- "type": "fulltext-index",
- "name": "color-test",
- "uuid": "6ea521a918bd3837",
- "sourceType": "gocbcore",
- "sourceName": "vector-sample",
- "sourceUUID": "614177a67bdfbd2823c5f9c3e62f5991",
- "planParams": {
- "maxPartitionsPerPIndex": 1024,
- "indexPartitions": 1
}, - "params": {
- "doc_config": {
- "docid_prefix_delim": "",
- "docid_regexp": "",
- "mode": "scope.collection.type_field",
- "type_field": "type"
}, - "mapping": {
- "analysis": { },
- "default_analyzer": "standard",
- "default_datetime_parser": "dateTimeOptional",
- "default_field": "_all",
- "default_mapping": {
- "dynamic": false,
- "enabled": false
}, - "default_type": "_default",
- "docvalues_dynamic": false,
- "index_dynamic": false,
- "store_dynamic": false,
- "type_field": "_type",
- "types": {
- "color.rgb": {
- "dynamic": false,
- "enabled": true,
- "properties": {
- "color": {
- "dynamic": false,
- "enabled": true,
- "fields": [
- {
- "analyzer": "en",
- "docvalues": true,
- "include_in_all": true,
- "include_term_vectors": true,
- "index": true,
- "name": "color",
- "store": true,
- "type": "text"
}
]
}, - "colorvect_dot": {
- "dynamic": false,
- "enabled": true,
- "fields": [
- {
- "dims": 3,
- "index": true,
- "name": "colorvect_dot",
- "similarity": "dot_product",
- "type": "vector",
- "vector_index_optimized_for": "recall"
}
]
}
}
}
}
}, - "store": {
- "indexType": "scorch",
- "segmentVersion": 16
}
}, - "sourceParams": { }
}, - "planPIndexes": [
- {
- "name": "vector-sample.color.color-test_6ea521a918bd3837_4c1c5584",
- "uuid": "1543820346544e08",
- "indexType": "fulltext-index",
- "indexName": "vector-sample.color.color-test",
- "indexUUID": "6ea521a918bd3837",
- "sourceType": "gocbcore",
- "sourceName": "vector-sample",
- "sourceUUID": "614177a67bdfbd2823c5f9c3e62f5991",
- "sourcePartitions": "0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239,240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255,256,257,258,259,260,261,262,263,264,265,266,267,268,269,270,271,272,273,274,275,276,277,278,279,280,281,282,283,284,285,286,287,288,289,290,291,292,293,294,295,296,297,298,299,300,301,302,303,304,305,306,307,308,309,310,311,312,313,314,315,316,317,318,319,320,321,322,323,324,325,326,327,328,329,330,331,332,333,334,335,336,337,338,339,340,341,342,343,344,345,346,347,348,349,350,351,352,353,354,355,356,357,358,359,360,361,362,363,364,365,366,367,368,369,370,371,372,373,374,375,376,377,378,379,380,381,382,383,384,385,386,387,388,389,390,391,392,393,394,395,396,397,398,399,400,401,402,403,404,405,406,407,408,409,410,411,412,413,414,415,416,417,418,419,420,421,422,423,424,425,426,427,428,429,430,431,432,433,434,435,436,437,438,439,440,441,442,443,444,445,446,447,448,449,450,451,452,453,454,455,456,457,458,459,460,461,462,463,464,465,466,467,468,469,470,471,472,473,474,475,476,477,478,479,480,481,482,483,484,485,486,487,488,489,490,491,492,493,494,495,496,497,498,499,500,501,502,503,504,505,506,507,508,509,510,511,512,513,514,515,516,517,518,519,520,521,522,523,524,525,526,527,528,529,530,531,532,533,534,535,536,537,538,539,540,541,542,543,544,545,546,547,548,549,550,551,552,553,554,555,556,557,558,559,560,561,562,563,564,565,566,567,568,569,570,571,572,573,574,575,576,577,578,579,580,581,582,583,584,585,586,587,588,589,590,591,592,593,594,595,596,597,598,599,600,601,602,603,604,605,606,607,608,609,610,611,612,613,614,615,616,617,618,619,620,621,622,623,624,625,626,627,628,629,630,631,632,633,634,635,636,637,638,639,640,641,642,643,644,645,646,647,648,649,650,651,652,653,654,655,656,657,658,659,660,661,662,663,664,665,666,667,668,669,670,671,672,673,674,675,676,677,678,679,680,681,682,683,684,685,686,687,688,689,690,691,692,693,694,695,696,697,698,699,700,701,702,703,704,705,706,707,708,709,710,711,712,713,714,715,716,717,718,719,720,721,722,723,724,725,726,727,728,729,730,731,732,733,734,735,736,737,738,739,740,741,742,743,744,745,746,747,748,749,750,751,752,753,754,755,756,757,758,759,760,761,762,763,764,765,766,767,768,769,770,771,772,773,774,775,776,777,778,779,780,781,782,783,784,785,786,787,788,789,790,791,792,793,794,795,796,797,798,799,800,801,802,803,804,805,806,807,808,809,810,811,812,813,814,815,816,817,818,819,820,821,822,823,824,825,826,827,828,829,830,831,832,833,834,835,836,837,838,839,840,841,842,843,844,845,846,847,848,849,850,851,852,853,854,855,856,857,858,859,860,861,862,863,864,865,866,867,868,869,870,871,872,873,874,875,876,877,878,879,880,881,882,883,884,885,886,887,888,889,890,891,892,893,894,895,896,897,898,899,900,901,902,903,904,905,906,907,908,909,910,911,912,913,914,915,916,917,918,919,920,921,922,923,924,925,926,927,928,929,930,931,932,933,934,935,936,937,938,939,940,941,942,943,944,945,946,947,948,949,950,951,952,953,954,955,956,957,958,959,960,961,962,963,964,965,966,967,968,969,970,971,972,973,974,975,976,977,978,979,980,981,982,983,984,985,986,987,988,989,990,991,992,993,994,995,996,997,998,999,1000,1001,1002,1003,1004,1005,1006,1007,1008,1009,1010,1011,1012,1013,1014,1015,1016,1017,1018,1019,1020,1021,1022,1023",
- "nodes": {
- "b7d460b7d4145482ac132dfa23727c5c": {
- "canRead": true,
- "canWrite": true,
- "priority": 0
}
}, - "indexParams": {
- "doc_config": {
- "docid_prefix_delim": "",
- "docid_regexp": "",
- "mode": "scope.collection.type_field",
- "type_field": "type"
}, - "mapping": {
- "analysis": { },
- "default_analyzer": "standard",
- "default_datetime_parser": "dateTimeOptional",
- "default_field": "_all",
- "default_mapping": {
- "dynamic": false,
- "enabled": false
}, - "default_type": "_default",
- "docvalues_dynamic": false,
- "index_dynamic": false,
- "store_dynamic": false,
- "type_field": "_type",
- "types": {
- "color.rgb": {
- "dynamic": false,
- "enabled": true,
- "properties": {
- "color": {
- "dynamic": false,
- "enabled": true,
- "fields": [
- {
- "analyzer": "en",
- "docvalues": true,
- "include_in_all": true,
- "include_term_vectors": true,
- "index": true,
- "name": "color",
- "store": true,
- "type": "text"
}
]
}, - "colorvect_dot": {
- "dynamic": false,
- "enabled": true,
- "fields": [
- {
- "dims": 3,
- "index": true,
- "name": "colorvect_dot",
- "similarity": "dot_product",
- "type": "vector",
- "vector_index_optimized_for": "recall"
}
]
}
}
}
}
}, - "store": {
- "indexType": "scorch",
- "segmentVersion": 16
}
}
}
], - "warnings": [ ]
}
If the Search index in the endpoint URL does not exist, this endpoint uses a JSON object in the request body to create a new index.
If the Search index already exists, this endpoint updates the Search index definition.
This endpoint is scoped and does not require a fully qualified {INDEX_NAME}
value.
BUCKET_NAME required | string The name of the bucket containing the Search index definition. |
SCOPE_NAME required | string The name of the scope containing the Search index definition. |
INDEX_NAME required | string^[A-Za-z][0-9A-Za-z_\-]*$ The name of the Search index definition. |
The full Search index definition. For a detailed list of all parameters for the request body, see Search Index JSON Properties.
name required | string (Index Name) The name of the Search index. For more information, see Initial Settings. |
type required | string (Index Type) The type of the Search index. For more information, see Initial Settings. |
sourceName required | string (Source Name) The name of the bucket where the Search index is stored. For more information, see Initial Settings. |
sourceUUID | string (Source UUID) The UUID of the bucket where the Search index is stored. For more information, see Initial Settings. |
sourceParams | object (Source Parameters) Advanced settings for Search index behavior. For more information, see Initial Settings. |
sourceType required | string (Source Type) The type of the bucket where the Search index is stored. For more information, see Initial Settings. |
params required | object (Index Parameters) The Search index's type identifier, type mappings, and analyzers. For more information, see Params Object. |
required | object (Plan Parameters) The Search index's partitioning and replication settings. For more information, see Plan Params Object. |
prevIndexUUID | string The UUID of the previous index. Intended for clients that want to check that they are not overwriting the Search index definition updates of concurrent clients. |
uuid | string (Index UUID) The UUID of the Search index. For more information, see Initial Settings. |
{- "name": "string",
- "type": "string",
- "sourceName": "string",
- "sourceUUID": "string",
- "sourceParams": { },
- "sourceType": "string",
- "params": { },
- "planParams": {
- "hierarchyRules": "string",
- "maxPartitionsPerPIndex": 0,
- "indexPartitions": 0,
- "nodePlanParams": "string",
- "numReplicas": 0,
- "planFrozen": true
}, - "prevIndexUUID": "string",
- "uuid": "string"
}
{- "status": "ok",
- "name": "travel-sample.inventory.travel-test",
- "uuid": "654cb62baebf2d26"
}
Delete the Search index definition from the bucket and scope specified in the endpoint URL.
This endpoint is scoped and does not require a fully qualified {INDEX_NAME}
value.
BUCKET_NAME required | string The name of the bucket containing the Search index definition. |
SCOPE_NAME required | string The name of the scope containing the Search index definition. |
INDEX_NAME required | string^[A-Za-z][0-9A-Za-z_\-]*$ The name of the Search index definition. |
{- "status": "ok",
- "uuid": "687be6a2ad647c34"
}