collections

Create a new collection

When a collection is created, we give it a name and describe the fields that will be indexed from the documents added to the collection.

post/collections

Request body

namestring required

Name of the collection

default_sorting_fieldstring

The name of an int32 / float field that determines the order in which the search results are ranked when a sort_by clause is not provided during searching. This field must indicate some kind of popularity.

token_separatorsstring[]

List of symbols or special characters to be used for splitting the text into individual words in addition to space and new-line characters.

symbols_to_indexstring[]

List of symbols or special characters to be indexed.

Example request

{
  "name": "companies",
  "fields": [
    {
      "name": "company_name",
      "type": "string",
      "facet": false
    },
    {
      "name": "num_employees",
      "type": "int32",
      "facet": false
    },
    {
      "name": "country",
      "type": "string",
      "facet": true
    }
  ],
  "default_sorting_field": "num_employees"
}

Response

Collection successfully created

namestring required

Name of the collection

default_sorting_fieldstring

The name of an int32 / float field that determines the order in which the search results are ranked when a sort_by clause is not provided during searching. This field must indicate some kind of popularity.

token_separatorsstring[]

List of symbols or special characters to be used for splitting the text into individual words in addition to space and new-line characters.

symbols_to_indexstring[]

List of symbols or special characters to be indexed.

num_documentsinteger required

Number of documents in the collection

created_atinteger required

Timestamp of when the collection was created

Example response

{
  "name": "companies",
  "fields": [
    {
      "name": "company_name",
      "type": "string",
      "facet": false
    },
    {
      "name": "num_employees",
      "type": "int32",
      "facet": false
    },
    {
      "name": "country",
      "type": "string",
      "facet": true
    }
  ],
  "default_sorting_field": "num_employees"
}

Changes