UNPKG

@netgrif/components-core

Version:

Netgrif Application engine frontend core Angular library

52 lines (51 loc) 2.38 kB
import { Operator } from './operator'; import { Query } from '../query/query'; import { Operators } from './operators'; /** * An operator that can be used on any field and matches entries with null or empty string values. * * Beware that if any additional constraints should be applied to the generated query the results may behave strangely. * Consult the [createQueryWithConstraint()]{@link IsNull#createQueryWithConstraint} method for more information. */ export declare class IsNull extends Operator<any> { constructor(); /** * @param elasticKeywords the queried fields * @returns Generates a query that matches null fields and fields with empty string values. */ createQuery(elasticKeywords: Array<string>): Query; /** * Counterintuitively elasticsearch query string queries behave weirdly when combining the queries with operators such as `AND`. * Because of this the following query: * * (dataSet.text_0.value:"") * * returns an empty result set. * * But query that should be intuitively more constraining: * * (dataSet.text_0.value:"") AND (processId:600168ccf68fea5241ae5e62) * * will return a non empty and expected result. * * This method exists to combat this issue and add the, sometimes necessary, constraint into the query generated by this operator. * * @param elasticKeywords the queried fields * @param constraint a constraining query that is distributively applied into the query generated by this operator. * If an empty query is provided the result will be the same as calling [createQuery()]{@link IsNull#createQuery}. * @returns a query with distributively applied constraint query */ createQueryWithConstraint(elasticKeywords: Array<string>, constraint: Query): Query; /** * @param elasticKeyword the queried field * @returns a string representation of the query that checks whether the field is null */ protected nullQueryString(elasticKeyword: string): string; /** * @param elasticKeyword the queried field * @returns a string representation of the query that checks whether the field has an empty string value */ protected emptyStringQueryString(elasticKeyword: string): string; getOperatorNameTemplate(): Array<string>; serialize(): Operators | string; }