import { BoolQuery, ExistsQuery, IdsQuery, ModeType, Query, QueryStringQuery, RangeQuery, RegexpQuery, TenantQuery, TermQuery, TermsQuery, TypeQuery, UUID, WildcardQuery } from 'ozone-type'; import { BasicOzoneType } from './types'; declare abstract class OzoneQueryBuilder { abstract done(): T; } declare type BuilderOrQuery = OzoneQueryBuilder | T; declare class BoolQueryBuilder extends OzoneQueryBuilder { private _or; private _and; private _not; minimumShouldMatch: number; setMinimumShouldMatch(value: number): this; or(queries: BuilderOrQuery[]): this; and(queries: BuilderOrQuery[]): this; not(queries: BuilderOrQuery[]): this; done(): BoolQuery; } declare function boolQuery(): BoolQueryBuilder; declare function existsQuery(field: string): ExistsQuery; /** * search array of ids * @param {string} ids * @return {IdsQuery} */ declare function idsQuery(ids: Array): IdsQuery; /** * ozone QueryStringQuery * @param {string} searchString string to search */ declare function quicksearch(searchString: string): QueryStringQuery; /** * Search in a range of value * @param field * @param param {from?: any, to?: any} */ declare function rangeQuery(field: string, param: { from?: any; to?: any; lowerIncluded?: boolean; upperIncluded?: boolean; }): RangeQuery; /** * Search with a regular expression * @param field * @param regexp * @param ignoreCase */ declare function regexpQuery(field: string, regexp: string, ignoreCase?: boolean): RegexpQuery; /** * Search inside a tenant * @param {ModeType} mode * @param {string} tenantId * @return {TenantQuery} */ declare function tenantQuery(mode: ModeType, tenantId: UUID): TenantQuery; /** * Search for a term in a field * @param {string} field * @param {BasicOzoneType} value * @param {boolean} ignoreCase * @return {TermQuery} */ declare function termQuery(field: string, value: BasicOzoneType, ignoreCase?: boolean): TermQuery; /** * Search for a list of terms in a field * @param {string} field * @param {BasicOzoneType[]} values * @param {boolean} ignoreCase * @return {TermQuery} */ declare function termsQuery(field: string, ...values: Array): TermsQuery; /** * Search for a list of terms in a field, with options * @param {string} field * @param {BasicOzoneType[]} values * @param {boolean} ignoreCase * @return {TermQuery} */ declare function termsQueryOptions(field: string, values: Array, options?: { ignoreCase?: boolean; exactMatch?: boolean; }): TermsQuery; /** * Search inside a type. * Not in subtype * @param {string} typeIdentifiers * @return {TypeQuery} */ declare function typeQuery(...typeIdentifiers: string[]): TypeQuery; /** * Search inside a type and its subtype(s) * @param {string} typeIdentifiers * @return {TypeQuery} */ declare function typeQueryWithSubType(...typeIdentifiers: string[]): TypeQuery; /** * Matches documents that have fields matching a wildcard expression (not analyzed). * Supported wildcards are *, which matches any character sequence (including the empty one), and ?, * which matches any single character. Note that this query can be slow, as it needs to iterate over many terms. * In order to prevent extremely slow wildcard queries, * a wildcard term should not start with one of the wildcards * or ?. * The wildcard query maps to Lucene WildcardQuery. * @param field * @param wildcard * @param ignoreCase * @param analyzed */ declare function wildcardQuery(field: string, wildcard: string, ignoreCase?: boolean, analyzed?: boolean): WildcardQuery; export { boolQuery, existsQuery, idsQuery, quicksearch, rangeQuery, regexpQuery, tenantQuery, termQuery, termsQuery, termsQueryOptions, typeQuery, typeQueryWithSubType, wildcardQuery };