Create BSI Frame and Field documentation

This commit is contained in:
Michael Baird 2017-09-27 16:51:16 -05:00
parent d44bdf9490
commit 35d6e945a8

View file

@ -162,6 +162,16 @@ The request payload is in JSON, and may contain the `options` field. The `option
* `inverseEnabled` (boolean): Enables [the inverted view]({{< ref "data-model.md#inverse" >}}) for this frame if `true`.
* `cacheType` (string): [ranked]({{< ref "data-model.md#ranked" >}}) or [LRU]({{< ref "data-model.md#lru" >}}) caching on this frame. Default is `lru`.
* `cacheSize` (int): Number of rows to keep in the cache. Default 50,000.
* `rangeEnabled` (boolean): Enables range-encoded fields in this frame.
* `fields` (array): List of range-encoded fields.
Each individual `field` contains the following:
* `name` (string): Field name.
* `type` (string): Field type, currently only "int" is supported.
* `min` (int): Minimum of the value range stored in this field.
* `max` (int): Maximum of the value range stored in this field.
Integer fields are stored as n-bit range-encoded values. Pilosa can use up to a 64-bit integer with one bit reserved for the non-null bitmap leaving up to a 63-bit signed integer represented between `min` and `max`.
Request:
```
@ -170,6 +180,12 @@ curl localhost:10101/index/user/frame/language \
-d '{"options": {"rowLabel": "language_id"}}'
```
```
curl localhost:10101/index/repository/frame/stats \
-X POST \
-d '{"rangeEnabled": true, "fields": [{"name": "pullrequests", "type": "int", "min": 0, "max": 1000000}]}'
```
Response:
```
{}
@ -223,6 +239,29 @@ Response:
{}
```
### Create Field
`POST /index/<index-name>/frame/<frame-name>/field/<field-name>`
Creates a new field to store integer values in the given frame.
The request payload is JSON, and it must contain the fields `type`, `min`, `max`.
* `type` (string): Field type, currently only "int" is supported.
* `min` (int): Minimum of the value range stored in this field.
* `max` (int): Maximum of the value range stored in this field.
Request:
```
curl localhost:10101/index/repository/frame/stats/field/pullrequests \
-X POST \
-d '{"type": "int", "min": 0, "max": 1000000}'
```
Response:
```
{}
```
### Create input definition
`POST /index/<index-name>/input-definition/<input-definition-name>`