-
Notifications
You must be signed in to change notification settings - Fork 259
Query processor and index
Howard Guo edited this page May 31, 2014
·
13 revisions
Query is a JSON structure (object or array) made of operations, including sub-queries.
Here is the complete list of all supported operations:
ID number as a string | No operation, the ID number goes to result |
"all" | Return all document IDs |
{"eq": #, "in": [#], "limit": #} | Index value lookup |
{"int-from": #, "int-to": #, "in": [#], "limit": #} | Hash lookup over a range of integers |
{"has": [#], "limit": #} | Return all documents that has the attribute set (not null) |
[sub-query1, sub-query2..] | Evaluate and union sub-query results. |
{"n": [sub-query1, sub-query2..]} | Evaluate and intersect sub-query results. |
{"c": [sub-query1, sub-query2..]} | Evaluate and complement sub-query results. |
limit
is optional.
Indexes works on a "path" - a series of attribute names locating the indexed value, for example, path a,b,c
will locate value 1
in document {"a": {"b": {"c": 1}}}
.
Index must be available before carrying out lookup queries.
tiedot supports a special case of range query - integer range lookup, which is essentially a batch of hash table lookups.
Better range query support will be introduced in later releases with help from another type of index.