This Confluence instance is now read-only, please head over to the Algolia Confluence instance for the same more up-to-date information

Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 2 Current »

What are the acceptable JSON formats?

Answer

When creating a new search collection for an app or store, you can import your data in a JSON format. Examples of acceptable JSON are mentioned below.

Nested JSON is not supported.

One record:

{
  "id": "123",
  "attrib":"value"
}

One record with list:

{
  "id": "123",
  "attrib":"value",
  "list":["item1","item2","item3"]
}

Multiple records:

[
  {
  "id": "1",
  "attrib":"value1"
  },
  {
  "id": "2",
  "attrib":"value2"
  }
]

Multiple records with list:

[
  {
    "id":"1",
    "attrib":"value",
    "list":["item1","item2","item3"]
  },
  {
    "id":"2", 
    "attrib":"value2", 
    "list":["item1"]
  },
  {
    "id":"3",
    "attrib":"value2",
    "list":"item1"
  }
]

Note that if a schema field is a list, a record can have a single value either with or without square brackets. Both formats are acceptable and will be indexed.

  • No labels