index

Create a document

/ create, / index

Create a document # Creates a new document. Examples # Insert a JSON document into the my-collection collection: POST /my-collection/_doc { "message": "GET /search HTTP/1.1 200 1070000", "org": { "id": "infini" } } The API returns the following result: { "_id": "0,0", "_version": 1, "_namespace": "default", "_collection": "my-collection", "result": "created", ... } The API supports passing a customized UUID as the document identify, eg: POST /my-collection/_doc/news_001 { "message": "GET /search HTTP/1. ...

Create an index

/ create, / index

Create an index # Creates a new index under a collectioin. Examples # The following request creates a new index called my-index under collection my-namespace:my-collection PUT /my-namespace:my-collection/_index/my_index Request # PUT /<target>/_index/<name> Path parameters # <target> (Required, string) The collection which the index belongs to. <name> (Required, string) Name of the index you wish to create.

Delete an index

/ delete, / index

Delete an index # Deletes an existing index under a collectioin. Examples # The following request deletes the index called my-index under collection my-namespace:my-collection DELETE /my-namespace:my-collection/_index/my_index Request # DELETE /<target>/_index/<name> Path parameters # <target> (Required, string) The collection which the index will be removed from. <name> (Required, string) Name of the index you wish to delete.

Get collection index

/ get, / index

Get collection index # See the following documents: Get index Get index alias Get index mapping Get index settings

Get index

/ get, / index

Get index # Returns information about one or more indices Examples # Get the information of all indices: GET /_index Get the information of the index named my-index under collection my-collection: GET /my-collection/_index/my-index Request # GET /_index GET /<target>/_index GET /<target>/_index/<index> Path Parameters # target (Required, String) Comma-separated, names of the collections to specify (wildcard supported) index (Required, String) Comma-separated, names of the indices to get (wildcard supported) ...

Get index mapping

/ mapping, / index

Get index mapping # Returns mapping information about one or more indices under the specified collection. Examples # Get the mapping information of the my-index index under collection my-collection: GET /my-collection/_index/my-index/_mapping Request # GET /<target>/_index/<index>/_mapping GET /<target>/_index/_mapping Path Parameters # target (Required, String) Comma-separated, names of the collections to specify (wildcard supported) index (Optional, String) Comma-separated, names of the indices to get (wildcard supported) ...

Get index setting

/ setting, / index

Get index setting # Returns setting information about one or more indices under the specified collection. Examples # Get the setting information of the my-index index under collection my-collection: GET /my-collection/_index/my-index/_setting Request # GET /<target>/_index/<index>/_setting GET /<target>/_index/_setting Path Parameters # target (Required, String) Comma-separated, names of the collections to specify (wildcard supported) index (Optional, String) Comma-separated, names of the indices to get (wildcard supported) ...

Index

/ index

Index # An index is a specialized data structure designed to improve search performance by efficiently organizing and storing data for quick retrieval. Each collection has a default index called default. You can create additional indices, each tailored to specific use cases to enhance search speed. An index can manage various aspects such as mappings, settings, and aliases: Mappings: Define the schema of the index layout, specifying how fields in the documents are indexed and stored. ...

Fetch a document

/ fetch, / index

Fetch a document # Retrieve an existing document by specifying its unique identifier. Examples # Fetch a document from the my-collection collection with customized uuid news_001: GET /my-collection/_doc/news_001 The API returns the following result: { "_id": "0,0", "_version": 1, "_collection": "default:my-collection", "_key" : "news_001", "found": true, "_source" : { "message": "GET /search HTTP/1.1 200 1070000", "org": { "id": "infini" } } } As you can see, the customized uuid are represented as _key within the document, and there is also a _id returned with value 0,0, this is the internal id generated by Pizza, and it is guaranteed to be unique, so you can also fetch this document by this value like this: ...

Replace a document

/ replace, / index

Replace a document # Replace an existing document by specifying its unique identifier and the new content. Examples # Replace a document news_001 of the collection my-collection with new content: PUT /my-collection/_doc/news_001 { "message": "GET /search HTTP/1.1 200 1070000", "org": { "id": "infinilabs" } } The API returns as following result: {"_id":"0,0", "_key":"news_001", "result":"updated"} After the document modification, If you perform the fetch request: GET /my-collection/_doc/news_001 It returns an updated document like: ...