Skip to content

GitLab

  • Menu
Projects Groups Snippets
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in
  • A api
  • Project information
    • Project information
    • Activity
    • Members
  • Packages & Registries
    • Packages & Registries
    • Package Registry
    • Container Registry
    • Infrastructure Registry
  • Wiki
    • Wiki
  • Activity
Collapse sidebar
  • ironapi
  • api
  • Wiki
  • Api
  • Queries
  • Query Search Options

Query Search Options · Changes

Page history
x authored Jan 21, 2022 by Andrea Pavlovic's avatar Andrea Pavlovic
Hide whitespace changes
Inline Side-by-side
API/Queries/Query-Search-Options.md
View page @ 48204178
......@@ -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 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
{"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"`.
......@@ -112,7 +125,7 @@ If a column on a big table is not indexed correctly, this search option will not
# 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!
......@@ -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.
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
{
"conds": {"me.id": {"-subtree": [1] }
......@@ -171,18 +184,18 @@ It can be combined with other search options, like this for example with "or":
"conds": [
{"me.id": {"-subtree": [1,2]}},
{"me.name" : {"-ilike" : "%a%"}}
]
]
}
```
with "and":
```
{
"conds":
"conds":
{"-and" : [
{"me.id": {"-subtree": [1,2]}},
{"me.name" : {"-ilike" : "%a%"}}
]
]
}
}
```
......@@ -197,4 +210,4 @@ Similar to -subtree, this allows to select the parent entries of an instance wit
{
"me.id" : {"-parents" : 5}
}
```
\ No newline at end of file
```
Clone repository
  • API
    • Available Endpoints
    • Changing Passwords
    • Form Input Types
    • Introduction
    • Logout
    • Plugins
    • Queries
    • Queries
      • Attributes
      • Context
      • Query Examples
      • Query Search Options
      • Referenced Instances
      • Saved Queries
    • Schema_Changes
    • Storing Files
View All Pages