Importing your data

Introduction

Generating a Kapsule with your own data starts with a JSON file, holding your entire dataset. You can upload given JSON file via the dropzone of the Home page (if signed in) by clicking on it or just dragging and dropping the file.

That file must, however, respect a certain structure, and some rules must be followed for the content.

First some terms should be defined :

  • Item : An item is the unit element of answer for the search engine. Depending on your use-case, it can be a document, a person, a company, etc.
  • Field : A field is a property of an item,

Structure

Root structure

First, the root structure has to be an array of items :

✔ Valid example :

[
    {
        "key1": "text_value",
        "key2": "text_value"
    },
    {
        "key1": "text_value",
        "key2": "text_value"
    },
]

⛔ Invalid example :

{
  "item1":{
    "key1": "text_value",
    "key2": "text_value"
  },
  "item2":{
    "key1": "text_value",
    "key2": "text_value"
  },
}

Item structure

For each item in the array, the item must be an object. We allow nested objects, but we don't allow lists that are not leafs of the structure.

This means that arrays can not contain objects (with the exception of the root node).

✔ Valid example :

[
    {
        "key1": "text_value",
        "key2": "nb_value",
        "key3": [
            "text_list_value1",
            "text_list_value2"
        ],
        "key4": [
            "text_nb_value1",
            "text_nb_value2"
        ],
        "key5": {
            "sub_key1": "text_value",
            "sub_key2": "nb_value",
            "sub_key3": {
                "subsub_key1": [
                    "text_list_value1",
                    "text_list_value2"
                ],
                "subsub_key2": "nb_value"
            }
        }
    }
]

⛔ Invalid example :

[
    {
        "key1": "text_value",
        "key2": [
            {
                "nestedkey1": "text_value",
                "nestedkey2": "nb_value"
            },
            {
                "nestedkey1": "text_value",
                "nestedkey2": "nb_value"
            }
        ]
    }
]

Format

Other than the points raised below, the file must of course be in a valid JSON format (Standard ECMA 404)

Keys

JSON keys must be in text format.

Values

Values types can be :
  • String
  • Number (int or float)
  • Boolean
  • Array. If so, all values of the array be of the same type (from types listed above)
  • Object (containing the above types)

Limitations

Somme limitations apply to your import. Some depends on your subscription model.

Import

The size of the dataset file is limited to :
  • 10MB. (Free subscription)
It cannot contain more than :
  • 1,000 items. (Free subscription)

Item

When JSON-formatted without spacing, each item must not exceed 30,000 characters.

Each JSON key must not exceed 100 characters.

Each textual value must not exceed 10000 characters.