| ... | @@ -101,9 +101,22 @@ If a column on a big table is not indexed correctly, this search option will not |
... | @@ -101,9 +101,22 @@ If a column on a big table is not indexed correctly, this search option will not |
|
|
|
|
|
|
|
This is an extension for IronAPI.
|
|
This is an extension for IronAPI.
|
|
|
|
|
|
|
|
|
This sorts the result by how "close" it is to the supplied text. See the [Similarity Postgres Documentation](https://www.postgresql.org/docs/9.6/static/pgtrgm.html).
|
|
|
|
|
|
|
|
`POST /data/system/entity/query`
|
|
|
|
|
|
|
|
```json
|
|
```json
|
|
|
{"attrs" : {"order_by" : {"-similarity" : ["me.name","constant"]}, "columns" : "me.name"}}
|
|
{
|
|
|
|
"attrs": {
|
|
|
|
"order_by": {
|
|
|
|
"-similarity": [
|
|
|
|
"me.name",
|
|
|
|
"constant"
|
|
|
|
]
|
|
|
|
},
|
|
|
|
"columns": "me.name"
|
|
|
|
}
|
|
|
|
}
|
|
|
```
|
|
```
|
|
|
|
|
|
|
|
This will be translated to sql `ORDER BY me.name <-> ? : "constant"`.
|
|
This will be translated to sql `ORDER BY me.name <-> ? : "constant"`.
|
| ... | @@ -112,7 +125,7 @@ If a column on a big table is not indexed correctly, this search option will not |
... | @@ -112,7 +125,7 @@ If a column on a big table is not indexed correctly, this search option will not |
|
|
|
|
|
|
|
# tsquery
|
|
# tsquery
|
|
|
|
|
|
|
|
This is an extension for IronAPI.
|
|
This is an extension for IronAPI.
|
|
|
|
|
|
|
|
The attrs are just for reference, they are not needed for the search query!
|
|
The attrs are just for reference, they are not needed for the search query!
|
|
|
|
|
|
| ... | @@ -148,7 +161,7 @@ This is an extension for IronAPI. Does the left JSONB value contain the right JS |
... | @@ -148,7 +161,7 @@ This is an extension for IronAPI. Does the left JSONB value contain the right JS |
|
|
This is an extension for IronAPI.
|
|
This is an extension for IronAPI.
|
|
|
|
|
|
|
|
For entities which represent a tree structure ("isTree": true in the universe), a search for a subtree of an element possible. The following will return all entries of the current entity which are "under" id 1, i.e. have either "1" or any of it's (children's) children as their parent:
|
|
For entities which represent a tree structure ("isTree": true in the universe), a search for a subtree of an element possible. The following will return all entries of the current entity which are "under" id 1, i.e. have either "1" or any of it's (children's) children as their parent:
|
|
|
|
|
|
|
|
```json
|
|
```json
|
|
|
{
|
|
{
|
|
|
"conds": {"me.id": {"-subtree": [1] }
|
|
"conds": {"me.id": {"-subtree": [1] }
|
| ... | @@ -171,18 +184,18 @@ It can be combined with other search options, like this for example with "or": |
... | @@ -171,18 +184,18 @@ It can be combined with other search options, like this for example with "or": |
|
|
"conds": [
|
|
"conds": [
|
|
|
{"me.id": {"-subtree": [1,2]}},
|
|
{"me.id": {"-subtree": [1,2]}},
|
|
|
{"me.name" : {"-ilike" : "%a%"}}
|
|
{"me.name" : {"-ilike" : "%a%"}}
|
|
|
]
|
|
]
|
|
|
}
|
|
}
|
|
|
```
|
|
```
|
|
|
|
|
|
|
|
with "and":
|
|
with "and":
|
|
|
```
|
|
```
|
|
|
{
|
|
{
|
|
|
"conds":
|
|
"conds":
|
|
|
{"-and" : [
|
|
{"-and" : [
|
|
|
{"me.id": {"-subtree": [1,2]}},
|
|
{"me.id": {"-subtree": [1,2]}},
|
|
|
{"me.name" : {"-ilike" : "%a%"}}
|
|
{"me.name" : {"-ilike" : "%a%"}}
|
|
|
]
|
|
]
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
```
|
|
```
|
| ... | @@ -197,4 +210,4 @@ Similar to -subtree, this allows to select the parent entries of an instance wit |
... | @@ -197,4 +210,4 @@ Similar to -subtree, this allows to select the parent entries of an instance wit |
|
|
{
|
|
{
|
|
|
"me.id" : {"-parents" : 5}
|
|
"me.id" : {"-parents" : 5}
|
|
|
}
|
|
}
|
|
|
``` |
|
``` |
|
\ No newline at end of file |
|
|