To let end users create complex Elasticsearch queries without having to know anything about Elasticsearch Asta7 offers a query builder or advanced search. Instead of a fixed advanced search users can create searches/filters of their own using a simple UI.
User Stories
/wiki/spaces/AO/pages/1634598936
Classes
FilterSearch
This is the root class that saves queries against a user. It is also possible to make a filter global.
QueryGroup
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 query groups or query rules.
QueryRule
This is used to link the query field, query operator, and user-provided value. It is also possible to negate the query using the negate
property of this class.
QueryOperator
This is what generates individual ES queries like query_string
, term
, range
, etc. It uses the query field and user-provided value and converts them to the appropriate ES query. For example, the ContainsQueryOperator
of TextQueryField
generates an ES query_string
query with wildcards at both ends.
QueryField
This class holds information about the actual ES field (name, label, nested path, etc.).
SortRule
This is used for generating sorting rules with field names and order. There can be multiple sorting rules.
How to operate
For every query in the filter user has to select a field first, 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.
Fields and Operators
Operators are dependent on fields and field types. Below is the list of all the current operators available:
Every operator can be negated with the not operator. All the text queries are case insensitive.
Field Type | Operator | Description |
---|---|---|
any | exists | Has value. |
varchar/text | contains | Has any token/word containing the provided value. |
starts with | Has any token/word that starts with the user provided value. | |
ends with | Has any token/word 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) | contains | Has any token/word containing the provided value. |
starts with | Has any token/word that starts with the user provided value. | |
ends with | Has any token/word that ends with the user provided value. |