Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

This is used to group multiple queries. Based on the group condition it can either be grouped as an AND query or an OR query. A query group can contain many multiple query groups or query rules.

...

For every query in the filter, the user has to select a field first, then . Similar to the basic mode tree select a dropdown of all the available fields will be available for every rule to select the field. Then based on the selected field a list of operators will appear, and based on the selected operator an appropriate value field will be shown.

...

Has any token/word that ends with the user provided value.

Field Type

Operator

Description

any

exists

Has value.

varchar/text/uuid

equals

Has value that equals the provided value ignoring the case.

varchar/text

containsmatches

Has any token/word matching the provided value.

varchar

contains

Has value containing the provided value.

starts with

Has any token/word value that starts with the user provided value.

ends with

Has any token/word value that ends with the user provided value.

varchar/text/uuid

equals

Has value that equals the provided value ignoring the case.

greate than

Has value that is greater than the provided value alphanumerically and ignoring the case.

greate than equals

Has value that is greater than or equal to the provided value alphanumerically and ignoring the case.

less than

Has value that is less than the provided value alphanumerically and ignoring the case.

less than equals

Has value that is less than or equals to the provided value alphanumerically and ignoring the case.

between

Has value that is greater than or less than the provided value alphanumerically and ignoring the case.

integer/float/serial/date/timestamp

equals

Has value that equals the provided value. (Including time in case of timestamp)

greate than

Has value that is greater than the provided value.

greate than equals

Has value that is greater than or equal to the provided value.

less than

Has value that is less than the provided value.

less than equals

Has value that is less than or equals to the provided value.

between

Has value that is greater than or less than the provided value.

boolean

yes

Has TRUE value.

no

Has FALSE value.

_amid field

equals

Has value that equals the provided value ignoring the case.

codeTableRef fields

in

Has value that equals to any of the provided set of values.

Digital file content field (a text field)

containsmatches

Has any token/word containing matching the provided value.

starts with

Has any token/word that starts with the user provided value.

ends with

Grouping

Rules can be divided into any number of groups. It is also possible to nest groups in any way needed. For each group, the group condition (AND/OR) can also be selected.

When generating the ES query all the rules in a group will be combined in the ES bool query. Furthermore, all the rules with the same or matching nested paths will be grouped in the same ES nested query. This makes sure that multiple rules can be added for a nested level or its sub-levels.

For example, If the group contains the following rules

Nested Path

Field

Operator

Value

serie

serie.identifikator

equals

A

serie

serie.navn

starts with

Oslo

serie.stykke

serie.stykke.startdato

greater than

1920

serie.stykke

serie.stykke.slutdato

less than

1950

serie.stykke.mappe

serie.stykke.mappe.navn

matches

Test

An ES query like the following would be generated

Code Block
languagejson
{
  "bool": {
    "must": [{
      "nested": {
        "path": "serie",
        "query": {
          "bool": {
            "must": [{
              "term": {
                "serie.identifikator": "A"
              }
            }, {
              "wildcard": {
                "serie.navn": "Oslo*"
              }
            }, {
              "nested": {
                "path": "serie.stykke",
                "query": {
                  "bool": {
                    "must": [{
                      "range": {
                        "serie.stykke.startdato": {
                          "gt": "1920"
                        }
                      }
                    }, {
                      "range": {
                        "serie.stykke.slutdato": {
                          "lt": "1950"
                        }
                      }
                    }, {
                      "nested": {
                        "path": "serie.stykke.mappe",
                        "query": {
                          "match": {
                            "serie.stykke.mappe.navn": {
                              "query": "Test"
                            }
                          }
                        }
                      }
                    }]
                  }
                }
              }
            }]
          }
        }
      }
    }]  
  }
}