import { HttpClient } from '@angular/common/http';
import { JSONLD, NodeType, ICycleJSONLD, ISourceJSONLD, ITermJSONLD, Source, IImpactAssessmentJSONLD } from '@hestia-earth/schema';
import { HeCommonService } from '../common/common.service';
import { searchableType } from './search.model';
import * as i0 from "@angular/core";
export declare type searchResult = ICycleJSONLD | ISourceJSONLD | IImpactAssessmentJSONLD | ITermJSONLD;
export declare type sortOrders = 'asc' | 'desc';
interface ISearchParamSort {
    [key: string]: sortOrders;
}
interface ISearchScript {
    _script: {
        type?: string;
        order?: sortOrders;
        script: string;
    };
}
export interface ISearchParams {
    limit?: number;
    offset?: number;
    fields?: string[];
    sort?: ISearchParamSort[] | ISearchScript;
    query?: any;
}
export interface ISearchResultExtended {
    _score: number;
    createdAt: string;
    location?: {
        lat: number;
        lon: number;
    };
    properties?: string[];
    expanded?: boolean;
    extended?: boolean;
    pinned?: boolean;
    loading?: boolean;
    selected?: boolean;
    inputsCount?: number;
    emissionsCount?: number;
    productsCount?: number;
}
export interface ISearchResults<C extends JSONLD<T>, T extends NodeType = searchableType> {
    /**
     * Amount of time the query took
     */
    time: number;
    /**
     * Numnber of results
     */
    count: number;
    results: (C & ISearchResultExtended)[];
}
export declare const MAX_RESULTS = 10000;
export declare const suggestMatchQuery: (query: string) => (Readonly<{
    match: {
        [x: string]: {
            boost?: number;
            query: any;
        };
    };
}> | Readonly<{
    multi_match: {
        analyzer?: "standard";
        boost?: number;
        query: string;
        fields: string[];
        type: "best_fields" | "most_fields" | "cross_fields" | "phrase" | "phrase_prefix" | "bool_prefix";
    };
}> | Readonly<{
    match_phrase_prefix: {
        nameSearchAsYouType: {
            query: string;
            boost: number;
        };
    };
}>)[];
export declare const suggestQuery: <T extends NodeType = searchableType>(query: string, type?: T, extraQueries?: any[]) => {
    bool: {
        must: any[];
        should: {
            bool: {
                must: Readonly<{
                    match: {
                        '@type': string;
                    };
                }>[];
                should: (Readonly<{
                    match: {
                        [x: string]: {
                            boost?: number;
                            query: any;
                        };
                    };
                }> | Readonly<{
                    multi_match: {
                        analyzer?: "standard";
                        boost?: number;
                        query: string;
                        fields: string[];
                        type: "best_fields" | "most_fields" | "cross_fields" | "phrase" | "phrase_prefix" | "bool_prefix";
                    };
                }> | Readonly<{
                    match_phrase_prefix: {
                        nameSearchAsYouType: {
                            query: string;
                            boost: number;
                        };
                    };
                }>)[];
                minimum_should_match: number;
            };
        }[];
        minimum_should_match: number;
    };
};
export declare class HeSearchService {
    protected http: HttpClient;
    protected commonService: HeCommonService;
    constructor(http: HttpClient, commonService: HeCommonService);
    search<C extends JSONLD<T>, T extends NodeType = searchableType>(params: ISearchParams): Promise<ISearchResults<C, T>>;
    count(params?: {}): Promise<number>;
    get$<C extends JSONLD<T>, T extends NodeType>(type: T, id: string): import("rxjs").Observable<C & ISearchResultExtended>;
    get<C extends JSONLD<T>, T extends NodeType>(type: T, id: string): Promise<C & ISearchResultExtended>;
    suggest<C extends JSONLD<T>, T extends NodeType = searchableType>(term: string, type?: T, extraQueries?: any[], fullQuery?: any, limit?: number, includes?: string[]): import("rxjs").Observable<Omit<C & ISearchResultExtended, "_score">[]>;
    suggestSource(term: string, limit?: number, fields?: string[], includes?: string[]): import("rxjs").Observable<Partial<Source>[]>;
    static ɵfac: i0.ɵɵFactoryDeclaration<HeSearchService, never>;
    static ɵprov: i0.ɵɵInjectableDeclaration<HeSearchService>;
}
export {};
