-
Notifications
You must be signed in to change notification settings - Fork 0
Formats
Nikita Ganzikov edited this page Jan 6, 2026
·
1 revision
Bright supports multiple input formats for adding documents to indexes.
Default format. Each line contains a separate JSON object representing a document.
Example:
curl -X POST "http://localhost:3000/indexes/products/documents?format=jsoneachrow" \
-H "Content-Type: application/json" \
-d '{"id": "1", "name": "Widget", "price": 19.99}
{"id": "2", "name": "Gadget", "price": 29.99}
{"id": "3", "name": "Doohickey", "price": 39.99}'Binary serialization format that is more compact and faster to parse than JSON.
Example:
# Using msgpack-cli or similar tool to encode JSON to MessagePack
echo '[{"id": "1", "name": "Widget", "price": 19.99}, {"id": "2", "name": "Gadget", "price": 29.99}]' | \
msgpack-encode | \
curl -X POST "http://localhost:3000/indexes/products/documents?format=msgpack" \
-H "Content-Type: application/msgpack" \
--data-binary @-Specify the format using the format query parameter when adding documents:
POST /indexes/:id/documents?format=jsoneachrow
POST /indexes/:id/documents?format=msgpack
If no format is specified, jsoneachrow is used by default.