Skip to content

Latest commit

 

History

History
1760 lines (1077 loc) · 52.3 KB

server.md

File metadata and controls

1760 lines (1077 loc) · 52.3 KB

Reindexer REST API

Overview

Reindexer is an embeddable, in-memory, document-oriented database with a high-level Query builder interface. Reindexer's goal is to provide fast search with complex queries. The Reindexer is compact and fast. It has not heavy dependencies. Complete reindexer docker image with all libraries and web interface size is just 15MB. Reindexer is fast.

Version information

Version : 2.3.0

License information

License : Apache 2.0
License URL : http://www.apache.org/licenses/LICENSE-2.0.html
Terms of service : null

URI scheme

BasePath : /api/v1
Schemes : HTTP

Tags

  • databases : Databases managment
  • indexes : Indexes management
  • items : Documents managment
  • namespaces : Namespaces managment
  • queries : Queries to reindexer (dsl/sql)
  • system : System methods

Produces

  • application/json

Paths

List available databases

GET /db

Description

This operation will output list of all available databases

Parameters

Type Name Description Schema
Query sort_order
optional
Sort Order enum (asc, desc)

Responses

HTTP Code Description Schema
200 successful operation Databases
400 Invalid arguments supplied StatusResponse

Tags

  • databases

Create new database

POST /db

Description

This operation will create new database. If database is already exists, then error will be returned.

Parameters

Type Name Description Schema
Body body
required
Database definintion Database

Responses

HTTP Code Description Schema
200 successful operation StatusResponse
400 Invalid parameters StatusResponse

Tags

  • databases

Drop database

DELETE /db/{database}

Description

This operation will remove complete database from memory and disk. All data, including namespaces, their documents and indexes will be erased. Can not be undone. USE WITH CAUTION.

Parameters

Type Name Description Schema
Path database
required
Database name string

Responses

HTTP Code Description Schema
200 successful operation StatusResponse
400 Invalid arguments supplied StatusResponse

Tags

  • databases

List available namespaces

GET /db/{database}/namespaces

Description

This operation will list all availavle namespaces in specified database. If database is not exists, then error will be returned.

Parameters

Type Name Description Schema
Path database
required
Database name string
Query sort_order
optional
Sort Order enum (asc, desc)

Responses

HTTP Code Description Schema
200 successful operation Namespaces
400 Invalid arguments supplied StatusResponse

Tags

  • namespaces

Create namespace

POST /db/{database}/namespaces

Description

This operation will create new namespace in specified database. If namespace is already exists, then operation do not nothing.

Parameters

Type Name Description Schema
Path database
required
Database name string
Body body
required
Namespace definintion Namespace

Responses

HTTP Code Description Schema
200 successful operation StatusResponse
400 Invalid parameters StatusResponse

Tags

  • namespaces

Get namespace description

GET /db/{database}/namespaces/{name}

Description

This operation will return specified namespace description, including options of namespace, and available indexes

Parameters

Type Name Description Schema
Path database
required
Database name string
Path name
required
Namespace name string

Responses

HTTP Code Description Schema
200 successful operation Namespace
400 Invalid arguments supplied StatusResponse

Tags

  • namespaces

Drop namespace

DELETE /db/{database}/namespaces/{name}

Description

This operation will delete completely namespace from memory and disk. All documents, indexes and metadata from namespace will be removed. Can not be undone. USE WITH CAUTION.

Parameters

Type Name Description Schema
Path database
required
Database name string
Path name
required
Namespace name string

Responses

HTTP Code Description Schema
200 successful operation StatusResponse
400 Invalid arguments supplied StatusResponse

Tags

  • namespaces

Truncate namespace

DELETE /db/{database}/namespaces/{name}/truncate

Description

This operation will delete all items from namespace.

Parameters

Type Name Description Schema
Path database
required
Database name string
Path name
required
Namespace name string

Responses

HTTP Code Description Schema
200 successful operation StatusResponse
400 Invalid arguments supplied StatusResponse

Tags

  • namespaces

Get list of namespace's meta info

GET /db/{database}/namespaces/{name}/metalist

Description

This operation will return list of keys of all meta of specified namespace

Parameters

Type Name Description Schema Default
Path database
required
Database name string
Path name
required
Namespace name string
Query limit
optional
If 0 - no limit integer 0
Query offset
optional
integer 0
Query sort_order
optional
Sort Order enum (asc, desc)
Query with_values
optional
Includ values in response boolean "false"

Responses

HTTP Code Description Schema
200 successful operation MetaListResponse
400 Invalid arguments supplied StatusResponse

Tags

  • namespaces

Get namespace's meta info by key

GET /db/{database}/namespaces/{name}/metabykey/{key}

Description

This operation will return value of namespace's meta with specified key

Parameters

Type Name Description Schema
Path database
required
Database name string
Path key
required
Meta key string
Path name
required
Namespace name string

Responses

HTTP Code Description Schema
200 Successful operation MetaByKeyResponse
400 Invalid arguments supplied StatusResponse

Tags

  • namespaces

Put namespace's meta info with specified key and value

PUT /db/{database}/namespaces/{name}/metabykey

Description

This operation will set namespace's meta with specified key and value

Parameters

Type Name Description Schema
Path database
required
Database name string
Path name
required
Namespace name string
Body meta_info
required
Meta info MetaInfo

Responses

HTTP Code Description Schema
200 successful operation UpdateResponse
400 Invalid arguments supplied StatusResponse

Tags

  • namespaces

Get documents from namespace

GET /db/{database}/namespaces/{name}/items

Description

This operation will select documents from namespace with specified filters, and sort them by specified sort order. Paging with limit and offset are supported.

Parameters

Type Name Description Schema
Path database
required
Database name string
Path name
required
Namespace name string
Query fields
optional
Comma-separated list of returned fields string
Query filter
optional
Filter with SQL syntax, e.g: field1 = 'v1' AND field2 > 'v2' string
Query limit
optional
Maximum count of returned items integer
Query offset
optional
Offset of first returned item integer
Query sort_field
optional
Sort Field string
Query sort_order
optional
Sort Order enum (asc, desc)

Responses

HTTP Code Description Schema
200 successful operation Items
400 Invalid arguments supplied StatusResponse

Tags

  • items

Update documents in namespace

PUT /db/{database}/namespaces/{name}/items

Description

This operation will UPDATE documents in namespace, by their primary keys. Each document should be in request body as separate JSON object, e.g.

{"id":100, "name": "Pet"}
{"id":101, "name": "Dog"}
...

Parameters

Type Name Description Schema
Path database
required
Database name string
Path name
required
Namespace name string
Query precepts
optional
Precepts to be done < string > array(multi)
Body body
required
object

Responses

HTTP Code Description Schema
200 successful operation ItemsUpdateResponse
400 Invalid status value StatusResponse

Tags

  • items

Insert documents to namespace

POST /db/{database}/namespaces/{name}/items

Description

This operation will INSERT documents to namespace, by their primary keys. Each document should be in request body as separate JSON object, e.g.

{"id":100, "name": "Pet"}
{"id":101, "name": "Dog"}
...

Parameters

Type Name Description Schema
Path database
required
Database name string
Path name
required
Namespace name string
Query precepts
optional
Precepts to be done < string > array(multi)
Body body
required
object

Responses

HTTP Code Description Schema
200 successful operation ItemsUpdateResponse
400 Invalid status value StatusResponse

Tags

  • items

Delete documents from namespace

DELETE /db/{database}/namespaces/{name}/items

Description

This operation will DELETE documents from namespace, by their primary keys. Each document should be in request body as separate JSON object, e.g.

{"id":100}
{"id":101}
...

Parameters

Type Name Description Schema
Path database
required
Database name string
Path name
required
Namespace name string
Query precepts
optional
Precepts to be done < string > array(multi)
Body body
required
object

Responses

HTTP Code Description Schema
200 successful operation ItemsUpdateResponse
400 Invalid status value StatusResponse

Tags

  • items

List available indexes

GET /db/{database}/namespaces/{name}/indexes

Description

This operation will return list of available indexes, from specified database and namespace.

Parameters

Type Name Description Schema
Path database
required
Database name string
Path name
required
Namespace name string

Responses

HTTP Code Description Schema
200 successful operation Indexes
400 Invalid arguments supplied StatusResponse

Tags

  • indexes

Update index in namespace

PUT /db/{database}/namespaces/{name}/indexes

Description

This operation will update index parameters. E.g. type of field or type of index. Operation is synchronious, so it can take long time, if namespace contains bunch of documents

Parameters

Type Name Description Schema
Path database
required
Database name string
Path name
required
Namespace name string
Body body
required
Index definition Index

Responses

HTTP Code Description Schema
200 successful operation StatusResponse
400 Invalid status value StatusResponse

Tags

  • indexes

Add new index to namespace

POST /db/{database}/namespaces/{name}/indexes

Description

This operation will create new index. If index is already exists with the different parameters, then error will be returned. Operation is synchronious, so it can take long time, if namespace contains bunch of documents.

Parameters

Type Name Description Schema
Path database
required
Database name string
Path name
required
Namespace name string
Body body
required
Index definition Index

Responses

HTTP Code Description Schema
200 successful operation StatusResponse
400 Invalid status value StatusResponse

Tags

  • indexes

Drop index from namespace

DELETE /db/{database}/namespaces/{name}/indexes/{indexname}

Description

This operation will remove index from namespace. No data will be erased. Operation is synchronious, so it can take long time, if namespace contains bunch of documents.

Parameters

Type Name Description Schema
Path database
required
Database name string
Path indexname
required
Index name string
Path name
required
Namespace name string

Responses

HTTP Code Description Schema
200 successful operation StatusResponse
400 Invalid status value StatusResponse

Tags

  • indexes

Query documents from namespace

GET /db/{database}/query

Description

This opertaion queries documents from namespace by SQL query. Query can be preced by EXPLAIN statement, then query execution plan will be returned with query results. Two level paging is supported. At first, applied normal SQL LIMIT and OFFSET, then limit and offset from http request.

Parameters

Type Name Description Schema
Path database
required
Database name string
Query limit
optional
Maximum count of returned items integer
Query offset
optional
Offset of first returned item integer
Query q
required
SQL query string
Query width
optional
Total width in rows of view for table format output integer
Query with_columns
optional
Return columns names and widths for table format output boolean

Responses

HTTP Code Description Schema
200 successful operation QueryItems
400 Invalid status value StatusResponse

Tags

  • queries

Query documents from namespace

POST /db/{database}/query

Description

This opertaion queries documents from namespace by DSL query.

Parameters

Type Name Description Schema
Path database
required
Database name string
Query width
optional
Total width in rows of view for table format output integer
Query with_columns
optional
Return columns names and widths for table format output boolean
Body body
required
DSL query Query

Responses

HTTP Code Description Schema
200 successful operation QueryItems
400 Invalid status value StatusResponse

Tags

  • queries

Delete documents from namespace

DELETE /db/{database}/query

Description

This opertaion removes documents from namespace by DSL query.

Parameters

Type Name Description Schema
Path database
required
Database name string
Body body
required
DSL query Query

Responses

HTTP Code Description Schema
200 successful operation No Content
400 Invalid status value StatusResponse

Tags

  • queries

Suggest for autocompletion of SQL query

GET /db/{database}/suggest

Description

This operation pareses SQL query, and suggests autocompletion variants

Parameters

Type Name Description Schema
Path database
required
Database name string
Query line
optional
Cursor line for suggest integer
Query pos
required
Cursor position for suggest integer
Query q
required
SQL query string

Responses

HTTP Code Description Schema
200 successful operation SuggestItems
400 Invalid status value StatusResponse

Tags

  • queries

Query documents from namespace

POST /db/{database}/sqlquery

Description

This opertaion queries documents from namespace by SQL query. Query can be preced by EXPLAIN statement, then query execution plan will be returned with query results.

Parameters

Type Name Description Schema
Path database
required
Database name string
Query width
optional
Total width in rows of view for table format output integer
Query with_columns
optional
Return columns names and widths for table format output boolean
Body q
required
SQL query string

Responses

HTTP Code Description Schema
200 successful operation QueryItems
400 Invalid status value StatusResponse

Tags

  • queries

Get system information

GET /check

Description

This operation will return system informatiom about server version, uptime, and resources consumtion

Responses

HTTP Code Description Schema
200 successful operation SysInfo
400 Invalid arguments supplied StatusResponse

Tags

  • system

Get activity stats information

GET /db/{database}/namespaces/%23activitystats/items

Description

This operation will return detailed informatiom about current activity of all connected to the database clients

Parameters

Type Name Description Schema
Path database
required
Database name string

Responses

HTTP Code Description Schema
200 successful operation ActivityStats
400 Invalid arguments supplied StatusResponse

Tags

  • system

Get memory stats information

GET /db/{database}/namespaces/%23memstats/items

Description

This operation will return detailed informatiom about database memory consumption

Parameters

Type Name Description Schema
Path database
required
Database name string

Responses

HTTP Code Description Schema
200 successful operation DatabaseMemStats
400 Invalid arguments supplied StatusResponse

Tags

  • system

Get performance stats information

GET /db/{database}/namespaces/%23perfstats/items

Description

This operation will return detailed informatiom about database performance timings. By default performance stats is turned off.

Parameters

Type Name Description Schema
Path database
required
Database name string

Responses

HTTP Code Description Schema
200 successful operation DatabasePerfStats
400 Invalid arguments supplied StatusResponse

Tags

  • system

Get SELECT queries performance stats information

GET /db/{database}/namespaces/%23queriesperfstats/items

Description

This operation will return detailed informatiom about database memory consumption. By default qureis performance stat is turned off.

Parameters

Type Name Description Schema
Path database
required
Database name string

Responses

HTTP Code Description Schema
200 successful operation QueriesPerfStats
400 Invalid arguments supplied StatusResponse

Tags

  • system

Update system config

PUT /db/{database}/namespaces/%23config/items

Description

This operation will update system configuration:

  • profiling configuration. It is used to enable recording of queries and overal performance;
  • log queries configurating.

Parameters

Type Name Description Schema
Path database
required
Database name string
Body body
required
SystemConfigItem

Responses

HTTP Code Description Schema
200 successful operation UpdateResponse
400 Invalid status value StatusResponse

Tags

  • system

Definitions

ActionCommand

Name Description Schema
command
optional
Command to execute enum (restart_replication)

ActivityStats

Name Description Schema
items
optional
< items > array
total_items
optional
Total count of documents, matched specified filters integer

items

Name Description Schema
client
required
Client identifier string
lock_description
optional
string
query
required
Query text string
query_id
required
Query identifier integer
query_start
required
Query start time string
state
required
Current operation state enum (in_progress, wait_lock, sending, indexes_lookup, bool, select_loop)
user
optional
User name string

AggregationResDef

Name Description Schema
facets
optional
Facets, calculated by aggregator < facets > array
fields
optional
Fields or indexes names for aggregation function < string > array
type
optional
Aggregation function enum (SUM, AVG, MIN, MAX, FACET)
value
optional
Value, calculated by aggregator number

facets

Name Description Schema
count
optional
Count of elemens these fields values integer
values
optional
Facet fields values < string > array

AggregationsDef

Name Description Schema
fields
optional
Fields or indexes names for aggregation function < string > array
limit
optional
Number of rows to get from result set
Minimum value : 0
integer
offset
optional
Index of the first row to get from result set
Minimum value : 0
integer
sort
optional
Specifies results sorting order < AggregationsSortDef > array
type
optional
Aggregation function enum (SUM, AVG, MIN, MAX, FACET)

AggregationsSortDef

Specifies facet aggregations results sorting order

Name Description Schema
desc
optional
Descent or ascent sorting direction boolean
field
required
Field or index name for sorting string

CacheMemStats

Name Description Schema
empty_count
optional
Count of empty elements slots in this cache integer
hit_count_limit
optional
Number of hits of queries, to store results in cache integer
items_count
optional
Count of used elements stored in this cache integer
total_size
optional
Total memory consumption by this cache integer

CommonPerfStats

Name Description Schema
last_sec_avg_latency_us
optional
Average latency (execution time) for queries to this object at last second integer
last_sec_avg_lock_time_us
optional
Average waiting time for acquiring lock to this object at last second integer
last_sec_qps
optional
Count of queries to this object, requested at last second integer
latency_stddev
optional
Standard deviation of latency values number
max_latency_us
optional
Maximum latency value integer
min_latency_us
optional
Minimal latency value integer
total_avg_latency_us
optional
Average latency (execution time) for queries to this object integer
total_avg_lock_time_us
optional
Average waiting time for acquiring lock to this object integer
total_queries_count
optional
Total count of queries to this object integer

Database

Name Description Schema
name
optional
Name of database
Pattern : "^[A-Za-z0-9_\\-]*$"
string

DatabaseMemStats

Name Description Schema
items
optional
Documents, matched specified filters < NamespaceMemStats > array
total_items
optional
Total count of documents, matched specified filters integer

DatabasePerfStats

Name Description Schema
items
optional
Documents, matched specified filters < NamespacePerfStats > array
total_items
optional
Total count of documents, matched specified filters integer

Databases

Name Description Schema
items
optional
< string > array
total_items
optional
Total count of databases integer

ExplainDef

Query execution explainings

Name Description Schema
indexes_us
optional
Indexes keys selection time integer
loop_us
optional
Intersection loop time integer
postprocess_us
optional
Query post process time integer
prepare_us
optional
Query prepare and optimize time integer
selectors
optional
Filter selectos, used to proccess query conditions < selectors > array
sort_index
optional
Index, which used for sort results string
total_us
optional
Total query execution time integer

selectors

Name Description Schema
comparators
optional
Count of comparators used, for this selector integer
cost
optional
Cost expectation of this selector integer
field
optional
Field or index name string
items
optional
Count of scanned documents by this selector integer
keys
optional
Number of uniq keys, processed by this selector (may be incorrect, in case of internal query optimization/caching integer
matched
optional
Count of processed documents, matched this selector integer
method
optional
Method, used to process condition enum (scan, index, inner_join, left_join)

FilterDef

If contains 'filters' then cannot contain 'cond', 'field' and 'value'. If not contains 'filters' then 'field' and 'cond' are required.

Name Description Schema
cond
optional
Condition operator enum (EQ, GT, GE, LE, LT, RANGE, SET, EMPTY)
field
optional
Field json path or index name for filter string
filters
optional
Filter for results documents < FilterDef > array
join_query
optional
JoinedDef
op
optional
Logic operator enum (AND, OR, NOT)
value
optional
Value of filter. Single integer or string for EQ, GT, GE, LE, LT condition, array of 2 elements for RANGE condition, or variable len array for SET condition object

FulltextConfig

Fulltext Index configuration

Name Description Schema
bm25_boost
optional
Boost of bm25 ranking
Default : 1.0
Minimum value : 0
Maximum value : 10
number (float)
bm25_weight
optional
Weight of bm25 rank in final rank 0: bm25 will not change final rank. 1: bm25 will affect to finl rank in 0 - 100% range
Default : 0.5
Minimum value : 0
Maximum value : 1
number (float)
distance_boost
optional
Boost of search query term distance in found document
Default : 1.0
Minimum value : 0
Maximum value : 10
number (float)
distance_weght
optional
Weight of search query terms distance in found document in final rank 0: distance will not change final rank. 1: distance will affect to final rank in 0 - 100% range
Default : 0.5
Minimum value : 0
Maximum value : 1
number (float)
enable_kb_layout
optional
Enable wrong keyboard layout variants processing. e.g. term 'keynbr' will match word 'лунтик'
Default : true
boolean
enable_numbers_search
optional
Enable number variants processing. e.g. term '100' will match words one hundred
Default : false
boolean
enable_translit
optional
Enable russian translit variants processing. e.g. term 'luntik' will match word 'лунтик'
Default : true
boolean
extra_word_symbols
optional
List of symbols, which will be threated as word part, all other symbols will be thrated as wors separators
Default : "-/+"
string
log_level
optional
Log level of full text search engine
Minimum value : 0
Maximum value : 4
integer
max_rebuild_steps
optional
Maximum steps withou full rebuild of ft - more steps faster commit slower select - optimal about 15.
Minimum value : 0
Maximum value : 500
integer
max_step_size
optional
Maximum unique words to step
Minimum value : 5
Maximum value : 1000000000
integer
max_typo_len
optional
Maximum word length for building and matching variants with typos.
Minimum value : 0
Maximum value : 100
integer
max_typos_in_word
optional
Maximum possible typos in word. 0: typos is disabled, words with typos will not match. N: words with N possible typos will match. It is not recommended to set more than 1 possible typo -It will seriously increase RAM usage, and decrease search speed
Minimum value : 0
Maximum value : 2
integer
merge_limit
optional
Maximum documents count which will be processed in merge query results. Increasing this value may refine ranking of queries with high frequency words, but will decrease search speed
Minimum value : 0
Maximum value : 65535
integer
min_relevancy
optional
Minimum rank of found documents. 0: all found documents will be returned 1: only documents with relevancy >= 100% will be returned
Default : 0.05
Minimum value : 0
Maximum value : 1
number (float)
stemmers
optional
List of stemmers to use < string > array
stop_words
optional
List of stop words. Words from this list will be ignored in documents and queries < string > array
term_len_boost
optional
Boost of search query term length
Default : 1.0
Minimum value : 0
Maximum value : 10
number (float)
term_len_weght
optional
Weight of search query term length in final rank. 0: term length will not change final rank. 1: term length will affect to final rank in 0 - 100% range
Default : 0.3
Minimum value : 0
Maximum value : 1
number (float)

Index

Name Description Schema
collate_mode
optional
String collate mode
Default : "none"
enum (none, ascii, utf8, numeric)
config
optional
FulltextConfig
field_type
required
Field data type enum (int, int64, double, string, bool, composite)
index_type
required
Index structure type
Default : "hash"
enum (hash, tree, text, -)
is_array
optional
Specifies, that index is array. Array indexes can work with array fields, or work with multiple fields
Default : false
boolean
is_dense
optional
Reduces the index size. For hash and tree it will save ~8 bytes per unique key value. Useful for indexes with high selectivity, but for tree and hash indexes with low selectivity can seriously decrease update performance;
Default : false
boolean
is_pk
optional
Specifies, that index is primary key. The update opertations will checks, that PK field is unique. The namespace MUST have only 1 PK index boolean
is_sparse
optional
Value of index may not present in the document, and threfore, reduce data size but decreases speed operations on index
Default : false
boolean
json_paths
required
Fields path in json object, e.g 'id' or 'subobject.field'. If index is 'composite' or 'is_array', than multiple json_paths can be specified, and index will get values from all specified fields. < string > array
name
required
Name of index, can contains letters, digits and underscores
Default : "id"
Pattern : "^[A-Za-z0-9_\\-]*$"
string
sort_order_letters
optional
Sort order letters
Default : ""
string

IndexCacheMemStats

Idset cache stats. Stores merged reverse index results of SELECT field IN(...) by IN(...) keys

Polymorphism : Composition

Name Description Schema
empty_count
optional
Count of empty elements slots in this cache integer
hit_count_limit
optional
Number of hits of queries, to store results in cache integer
items_count
optional
Count of used elements stored in this cache integer
total_size
optional
Total memory consumption by this cache integer

IndexMemStat

Name Description Schema
data_size
optional
Total memory consumption of documents's data, holded by index integer
fulltext_size
optional
Total memory consumption of fulltext search structures integer
idset_btree_size
optional
Total memory consumption of reverse index b-tree structures. For dense and store indexes always 0 integer
idset_cache
optional
IndexCacheMemStats
idset_plain_size
optional
Total memory consumption of reverse index vectors. For store ndexes always 0 integer
name
optional
Name of index. There are special index with name -tuple. It's stores original document's json structure with non indexe fields string
sort_orders_size
optional
Total memory consumption of SORT statement and GT, LT conditions optimized structures. Applicabe only to tree indexes integer
unique_keys_count
optional
Count of unique keys values stored in index integer

Indexes

Name Description Schema
items
optional
< Index > array
total_items
optional
Total count of indexes integer

Items

Name Description Schema
items
optional
Documents, matched specified filters < object > array
total_items
optional
Total count of documents, matched specified filters integer

ItemsUpdateResponse

Name Description Schema
items
optional
Updated documents. Contains only if precepts were provided < object > array
updated
optional
Count of updated items integer

JoinCacheMemStats

Join cache stats. Stores results of selects to right table by ON condition

Polymorphism : Composition

Name Description Schema
empty_count
optional
Count of empty elements slots in this cache integer
hit_count_limit
optional
Number of hits of queries, to store results in cache integer
items_count
optional
Count of used elements stored in this cache integer
total_size
optional
Total memory consumption by this cache integer

JoinedDef

Name Description Schema
filters
optional
Filter for results documents < FilterDef > array
limit
optional
Maximum count of returned items integer
namespace
required
Namespace name string
offset
optional
Offset of first returned item integer
sort
optional
SortDef
true
optional
Join ON statement < OnDef > array
type
required
Join type enum (LEFT, INNER, ORINNER)

MetaByKeyResponse

Meta info of the specified namespace

Name Schema
key
required
string
value
required
string

MetaInfo

Meta info to be set

Name Schema
key
required
string
value
required
string

MetaListResponse

List of meta info of the specified namespace

Name Description Schema
meta
required
< meta > array
total_items
required
Total count of meta info in the namespace integer

meta

Name Description Schema
key
required
string
value
optional
Optional: Provided if 'with_values' = true string

Namespace

Name Description Schema
indexes
optional
< Index > array
name
optional
Name of namespace
Pattern : "^[A-Za-z0-9_\\-]*$"
string
storage
optional
storage

storage

Name Description Schema
enabled
optional
If true, then documents will be stored to disc storage, else all data will be lost on server shutdown boolean

NamespaceMemStats

Name Description Schema
data_size
optional
Raw size of documents, stored in the namespace, except string fields integer
indexes
optional
Memory consumption of each namespace index < IndexMemStat > array
items_count
optional
Total count of documents in namespace integer
join_cache
optional
JoinCacheMemStats
name
optional
Name of namespace string
query_cache
optional
QueryCacheMemStats
replication
optional
ReplicationStats
storage_ok
optional
Status of disk storage boolean
storage_path
optional
Filesystem path to namespace storage string
total
optional
Summary of total namespace memory consumption total
updated_unix_nano
optional
[[deperecated]]. do not use integer

total

Name Description Schema
cache_size
optional
Total memory consumption of namespace's caches. e.g. idset and join caches integer
data_size
optional
Total memory size of stored documents, including system structures integer
indexes_size
optional
Total memory consumption of namespace's indexes integer

NamespacePerfStats

Name Description Schema
indexes
optional
Memory consumption of each namespace index < indexes > array
name
optional
Name of namespace string
selects
optional
SelectPerfStats
updates
optional
UpdatePerfStats

indexes

Name Description Schema
name
optional
Name of index string
selects
optional
SelectPerfStats
updates
optional
UpdatePerfStats

Namespaces

Name Description Schema
items
optional
< items > array
total_items
optional
Total count of namespaces integer

items

Name Description Schema
name
optional
Name of namespace string
storage_enabled
optional
If true, then documents will be stored to disc storage, else all data will be lost on server shutdown boolean

NamespacesConfig

Name Description Schema
join_cache_mode
optional
Join cache mode enum (aggressive)
lazyload
optional
Enable namespace lazy load (namespace shoud be loaded from disk on first call, not at reindexer startup) boolean
log_level
optional
Log level of queries core logger enum (none, error, warning, info, trace)
merge_limit_count
optional
Merge write namespace after get thi count of operations integer
namespace
optional
Name of namespace, or * for setting to all namespaces string
optimization_sort_workers
optional
Maximum number of background threads of sort indexes optimization. 0 - disable sort optimizations integer
optimization_timeout_ms
optional
Timeout before background indexes optimization start after last update. 0 - disable optimizations integer
start_copy_politics_count
optional
Copy namespce policts will start only after item's count become greater in this param integer
unload_idle_threshold
optional
Unload namespace data from RAM after this idle timeout in seconds. If 0, then data should not be unloaded integer

OnDef

Name Description Schema
cond
required
Condition operator enum (EQ, GT, GE, LE, LT, RANGE, SET, EMPTY)
left_field
required
Field from left namespace (main query namespace) string
op
optional
Logic operator enum (AND, OR, NOT)
right_field
required
Field from right namespace (joined query namespace) string

ProfilingConfig

Name Description Schema
activitystats
optional
Enables tracking activity statistics
Default : false
boolean
memstats
optional
Enables tracking memory statistics
Default : true
boolean
perfstats
optional
Enables tracking overal perofrmance statistics
Default : false
boolean
queries_threshold_us
optional
Minimum query execution time to be recoreded in #queriesperfstats namespace integer
queriesperfstats
optional
Enables record queries perofrmance statistics
Default : false
boolean

QueriesPerfStats

Name Description Schema
items
optional
Documents, matched specified filters < QueryPerfStats > array
total_items
optional
Total count of documents, matched specified filters integer

Query

Name Description Schema
aggregations
optional
Ask query calculate aggregation < AggregationsDef > array
distinct
optional
Distinct field/index name. Results will contain's document with distinct field value string
explain
optional
Add query execution explain information
Default : false
boolean
filters
optional
Filter for results documents < FilterDef > array
limit
optional
Maximum count of returned items integer
merge_queries
optional
Merged queries to be merged with main query < Query > array
namespace
required
Namespace name string
offset
optional
Offset of first returned item integer
req_total
optional
Ask query to calculate total documents, match condition
Default : "disabled"
enum (disabled, enabled, cached)
select_filter
optional
Filter fields of returned document. Can be dot separated, e.g 'subobject.field' < string > array
select_functions
optional
Add extra select functions to query < string > array
sort
optional
Specifies results sorting order < SortDef > array

QueryCacheMemStats

Query cache stats. Stores results of SELECT COUNT(*) by Where conditions

Polymorphism : Composition

Name Description Schema
empty_count
optional
Count of empty elements slots in this cache integer
hit_count_limit
optional
Number of hits of queries, to store results in cache integer
items_count
optional
Count of used elements stored in this cache integer
total_size
optional
Total memory consumption by this cache integer

QueryColumnDef

Query columns for table outputs

Name Description Schema
max_chars
optional
Maximum count of chars in column number
name
optional
Column name string
width_chars
optional
Column width in chars number
width_percents
optional
Column width in percents of total width number

QueryItems

Name Description Schema
aggregations
optional
Aggregation functions results < AggregationResDef > array
cache_enabled
optional
Enables to client cache returned items. If false, then returned items has been modified by reindexer, e.g. by select filter, or by functions, and can't be cached boolean
columns
optional
Columns for table output < QueryColumnDef > array
explain
optional
ExplainDef
items
optional
Documents, matched query < object > array
namespaces
optional
Namespaces, used in query < string > array
query_total_items
optional
Total count of documents, matched query integer

QueryPerfStats

Performance statistics per each query

Polymorphism : Composition

Name Description Schema
last_sec_avg_latency_us
optional
Average latency (execution time) for queries to this object at last second integer
last_sec_avg_lock_time_us
optional
Average waiting time for acquiring lock to this object at last second integer
last_sec_qps
optional
Count of queries to this object, requested at last second integer
latency_stddev
optional
Standard deviation of latency values number
longest_query
optional
not normalized SQL representation of longest query string
max_latency_us
optional
Maximum latency value integer
min_latency_us
optional
Minimal latency value integer
query
optional
normalized SQL representation of query string
total_avg_latency_us
optional
Average latency (execution time) for queries to this object integer
total_avg_lock_time_us
optional
Average waiting time for acquiring lock to this object integer
total_queries_count
optional
Total count of queries to this object integer

ReplicationConfig

Name Description Schema
cluster_id
optional
Cluser ID - must be same for client and for master integer
force_sync_on_logic_error
optional
force resync on logic error conditions boolean
force_sync_on_wrong_data_hash
optional
force resync on wrong data hash conditions boolean
master_dsn
optional
DSN to master. Only cproto schema is supported string
namespaces
optional
List of namespaces for replication. If emply, all namespaces. All replicated namespaces will become read only for slave < string > array
role
optional
Replication role enum (none, slave, master)
timeout_sec
optional
Network timeout for communication with master, in seconds integer

ReplicationStats

State of namespace replication

Name Description Schema
cluster_id
optional
Cluster ID - must be same for client and for master integer
data_hash
optional
Hashsum of all records in namespace integer
error_code
optional
Error code of last replication integer
error_message
optional
Error message of last replication string
incarnation_counter
optional
Number of storage's master <-> slave switches integer
last_lsn
optional
Last Log Sequence Number (LSN) of applied namespace modification integer
slave_mode
optional
If true, then namespace is in slave mode boolean
wal_count
optional
Write Ahead Log (WAL) records count integer
wal_size
optional
Total memory consumption of Write Ahead Log (WAL) integer

SelectPerfStats

Performance statistics for select operations

Polymorphism : Composition

Name Description Schema
last_sec_avg_latency_us
optional
Average latency (execution time) for queries to this object at last second integer
last_sec_avg_lock_time_us
optional
Average waiting time for acquiring lock to this object at last second integer
last_sec_qps
optional
Count of queries to this object, requested at last second integer
latency_stddev
optional
Standard deviation of latency values number
max_latency_us
optional
Maximum latency value integer
min_latency_us
optional
Minimal latency value integer
total_avg_latency_us
optional
Average latency (execution time) for queries to this object integer
total_avg_lock_time_us
optional
Average waiting time for acquiring lock to this object integer
total_queries_count
optional
Total count of queries to this object integer

SortDef

Specifies results sorting order

Name Description Schema
desc
optional
Descent or ascent sorting direction boolean
field
required
Field or index name for sorting string
values
optional
Optional: Documents with this values of field will be returned first < object > array

StatusResponse

Name Description Schema
description
optional
Text description of error details string
response_code
optional
Error code:
* 0 - errOK
* 1 - errParseSQL
* 2 - errQueryExec
* 3 - errParams
* 4 - errLogic
* 5 - errParseJson
* 6 - errParseDSL
* 7 - errConflict
* 8 - errParseBin
* 9 - errForbidden
* 10 - errWasRelock
* 11 - errNotValid
* 12 - errNetwork
* 13 - errNotFound
* 14 - errStateInvalidated
* 15 - errBadTransaction
* 16 - errOutdatedWAL
* 17 - errNoWAL
* 18 - errDataHashMismatch
integer
success
optional
Status of operation boolean

SuggestItems

Name Description Schema
suggests
optional
Suggested query autocompletion variants < string > array

SysInfo

Name Description Schema
current_allocated_bytes
optional
Current inuse allocated memory size in bytes integer
heap_size
optional
Current heap size in bytes integer
pageheap_free
optional
Heap free size in bytes integer
pageheap_unmapped
optional
Unmapped free heap size in bytes integer
start_time
optional
Server start time in unix timestamp integer
uptime
optional
Server uptime in seconds integer
version
optional
Server version string

SystemConfigItem

Name Description Schema
action
optional
ActionCommand
namespaces
optional
< NamespacesConfig > array
profiling
optional
ProfilingConfig
replication
optional
ReplicationConfig
type
required
Default : "profiling" enum (profiling, namespaces, replication, action)

UpdatePerfStats

Performance statistics for update operations

Polymorphism : Composition

Name Description Schema
last_sec_avg_latency_us
optional
Average latency (execution time) for queries to this object at last second integer
last_sec_avg_lock_time_us
optional
Average waiting time for acquiring lock to this object at last second integer
last_sec_qps
optional
Count of queries to this object, requested at last second integer
latency_stddev
optional
Standard deviation of latency values number
max_latency_us
optional
Maximum latency value integer
min_latency_us
optional
Minimal latency value integer
total_avg_latency_us
optional
Average latency (execution time) for queries to this object integer
total_avg_lock_time_us
optional
Average waiting time for acquiring lock to this object integer
total_queries_count
optional
Total count of queries to this object integer

UpdateResponse

Name Description Schema
updated
optional
Count of updated items integer