SELECT

Search structure

?$$={
    "select":[  ver<1>  ]  "select": “*”,

    "filters":
    [
        {
            "field":"  ver<2>  ",
            "term":"  ver<3>  ",
            "operation":"  ver<4>  "
        },

        {
            "field":"  ver<2>  ",
            "term":"  ver<3>  ",
            "operation":"  ver<4>  "
        }
    ],

    "literal": "  ver<5>  ",

    "limit" : "   ver<6>   ",

    "offset" : "  ver<6>  ",

    "order_by":{"asc":[  ver<1>   ], "desc":[  ver<1>   ]}
}

1 [comma-separated field alias, it is possible to use synchronous relational fields,
It is possible to also pass "*" defining that if you want all fields]
2 [name of field]
3 [terms to be searched]
4 [operators (=,> =, <=,>, <, contains, like)]
5 [search condition equal to WHERE, and it is not possible to use reserved words like
(Select, update, insert)]
6 [numerical value limiting the search]

Obs: Can parameters of this json can be used independently,
That is not necessary to inform all ...

Find all json reg from a base

$$={"select":["id_doc"]}
Or 
$$={"select":"*"}

Filter a term in a given field

$$={"filters":[{"field":"name","term":"33333","operator":"="}]}

Searching for empty date

?$$={"select":["id_reg","json_reg"],"filters":[{"field":"dt_index_tex","term":null,"operation":"="}]}

Searching with literal

?$$={"select":["id_doc","document"],"literal":"id_doc=1"}

Search using multiple parameters

$$ = {
    "select":["id_base","name_base"],
    "filters":
    [
        {
            "field":"name",
            "term":"maria",
            "operation":"="
        },
        {
            "field":"number",
            "term":"4",
            "operation":">"
        },
    ],
    "limit":"10",
    "offset":"1",
    "order_by":{"asc":["id_base"], "desc":["id_base"]},
    "distinct":"true"
}

Multivalued Group Search
To search a field in a multivalued group, the field must be sorted.
Given the group with the structure:

{
    "group": 
    {
        "content": 
        [
            {
                "field": {
                    "name": "int_id_doc_assunt",
                    "datatype": "Integer",
                    "required": false,
                    "alias": "Id linked subject",
                    "multivalued": false,
                    "indices": 
                    [
                        "Textual",
                        "Ordered"
                    ],
                    "description": "Id related subject"
                }
            }
        ],
        "metadata": 
        {
            "alias": "Related topics",
            "description": "Subjects that are linked to the archive!",
            "multivalued": true,
            "name": "mg_assunt_vinc"
        }
    }
}

The search in the field "int_id_doc_assunt" for value 160 would be:

$$={
    "literal": "160 = any (int_id_doc_assunt)"
}

Set with all data:

{
    "result_count": 4,
    "limit": 10,
    "results": 
    [
        {
            "mg_assunt_vinc": 
            [
                {
                    "int_id_doc_assunt": 158
                },
                {
                    "int_id_doc_assunt": 159
                },
                {
                    "int_id_doc_assunt": 160
                }
            ],
            "_metadata": 
            {
                "dt_doc": "31/05/2015 03:51:50",
                "id_doc": 3,
                "dt_idx": "31/05/2015 04:51:29",
                "dt_last_up": "31/05/2015 04:51:29"
            },
            "str_file_hash": "09524006c31f57c01a72fcab91858e33177f2e69",
            "file_arq": 
            {
                "mimetype": "application/octet-stream",
                "uuid": "b8d5cb51-a870-4b54-a843-0e34561fc773",
                "filename": "TowerFall Ascension.desktop",
                "filesize": 181,
                "id_file": "f0caf116-1b3e-3e5b-aa90-690bb1e0210a"
            }
        },
        {
            "mg_assunt_vinc": 
            [
                {
                    "int_id_doc_assunt": 158
                },
                {
                    "int_id_doc_assunt": 159
                }
            ],
            "_metadata": 
            {
                "dt_doc": "31/05/2015 03:51:50",
                "id_doc": 1,
                "dt_idx": "31/05/2015 04:43:57",
                "dt_last_up": "31/05/2015 04:43:57"
            },
            "str_file_hash": "a705dc01c5d4bcdb9185c72f0398f7baee47f3af",
            "file_arq": 
            {
                "mimetype": "application/json",
                "uuid": "6998eb4f-7d8e-450f-8794-1a75349f06ca",
                "filename": "put_es_expedido.json",
                "filesize": 5114,
                "id_file": "acdb7014-ad17-3194-a09a-e86c2a7113d0"
            }
        },
        {
            "mg_assunt_vinc": 
            [
                {
                    "int_id_doc_assunt": 158
                },
                {
                    "int_id_doc_assunt": 159
                }
            ],
            "_metadata": 
            {
                "dt_doc": "31/05/2015 03:51:50",
                "id_doc": 2,
                "dt_idx": "31/05/2015 04:43:58",
                "dt_last_up": "31/05/2015 04:43:58"
            },
            "str_file_hash": "3fdfe6d0b22fcc4326fdfd58f2310615fe104310",
            "file_arq": 
            {
                "mimetype": "application/octet-stream",
                "uuid": "2632d591-0dc4-4874-9bfe-01a9f6afee56",
                "filename": "steam.desktop",
                "filesize": 2191,
                "id_file": "cda2cb31-50bf-3b1d-9268-81b11d36d242"
            }
        },
        {
            "mg_assunt_vinc": 
            [
                {
                    "int_id_doc_assunt": 158
                },
                {
                    "int_id_doc_assunt": 159
                },
                {
                    "int_id_doc_assunt": 160
                }
            ],
            "_metadata": 
            {
                "dt_doc": "31/05/2015 03:51:51",
                "id_doc": 4,
                "dt_idx": null,
                "dt_last_up": "31/05/2015 04:51:29"
            },
            "str_file_hash": "5ecd61ecf586d1a83b98f0eeb0b59f1823cb383e",
            "file_arq": 
            {
                "mimetype": "application/octet-stream",
                "uuid": "98009be3-f26e-4c50-9da4-9c6ac78939e3",
                "filename": "vimrc",
                "filesize": 12114,
                "id_file": "b138a8c3-1823-37c4-a719-ef5fee9f4ba8"
            }
        }
    ],
    "offset": 0
}

After the survey:

{
    "result_count": 2,
    "limit": 10,
    "results": 
    [
        {
            "mg_assunt_vinc": 
            [
                {
                    "int_id_doc_assunt": 158
                },
                {
                    "int_id_doc_assunt": 159
                },
                {
                    "int_id_doc_assunt": 160
                }
            ],
            "_metadata": 
            {
                "dt_doc": "31/05/2015 03:51:50",
                "id_doc": 3,
                "dt_idx": "31/05/2015 04:51:29",
                "dt_last_up": "31/05/2015 04:51:29"
            },
            "str_file_hash": "09524006c31f57c01a72fcab91858e33177f2e69",
            "file_arq": 
            {
                "mimetype": "application/octet-stream",
                "uuid": "b8d5cb51-a870-4b54-a843-0e34561fc773",
                "filename": "TowerFall Ascension.desktop",
                "filesize": 181,
                "id_file": "f0caf116-1b3e-3e5b-aa90-690bb1e0210a"
            }
        },
        {
            "mg_assunt_vinc": 
            [
                {
                    "int_id_doc_assunt": 158
                },
                {
                    "int_id_doc_assunt": 159
                },
                {
                    "int_id_doc_assunt": 160
                }
            ],
            "_metadata": 
            {
                "dt_doc": "31/05/2015 03:51:51",
                "id_doc": 4,
                "dt_idx": null,
                "dt_last_up": "31/05/2015 04:51:29"
            },
            "str_file_hash": "5ecd61ecf586d1a83b98f0eeb0b59f1823cb383e",
            "file_arq": 
            {
                "mimetype": "application/octet-stream",
                "uuid": "98009be3-f26e-4c50-9da4-9c6ac78939e3",
                "filename": "vimrc",
                "filesize": 12114,
                "id_file": "b138a8c3-1823-37c4-a719-ef5fee9f4ba8"
            }
        }
    ],
    "offset": 0
}