API Docs for: 2.0.20133.2
Show:

File: src\internal\api\search\searchConfig.ts

/// <reference path="searchFacets.ts"/>
/// <reference path="searchFilter.ts"/>
/// <reference path="searchOrderByExpression.ts"/>

/**
* @module API
* @submodule API Search
* @namespace api.search
*/

namespace internal.api.search {

    export enum HttpMethod {
        GET = 0,
        POST = 1
    }

    /**
     * Configuration for search api
     * @class SearchConfig 
     */
    export class SearchConfig {
        /**
         * HTTP Method to use ("GET" or "POST")
         * @property {string} query
         */
        public httpMethod: HttpMethod;

        /**
         * Search query
         * @property {string} query
         */
        public query: string;

        /**
         * Locale for search results
         * @property {string} locale
         */
        public locale: string;

        /**
         * Comma delimited scopes for the search results
         * @property {string} scopes
         */
        public scopes: string;

        /**
         * Total number of search results to be returned
         * @property {number} count
         */
        public count: number;

        /**
         * Number of search results returned for paging needs
         * @property {number} skip
         */
        public skip: number;

        /**
         * The desired search provider for the request
         * @property {string} searchProvider
         */
        public searchProvider: string;

        /**
         * The desired instant answer provider for the request
         * @property {string} instantAnswerProvider
         */
        public instantAnswerProvider: string;

        /**
         * Receive instant answers along with search results
         * @property {boolean} includeInstantAnswers
         */
        public includeInstantAnswer: boolean;

        /**
         * Receive webSearchResults
         * @property {boolean} includeWebSearchResults
         */
        public includeWebSearchResults: boolean;

        /**
         * Receive hitHighlights
         * @property {boolean} enableHitHighlights
         */
        public enableHitHighlights: boolean;

        /**
         * The desired search filters for the request
         * @property {SearchFilter} filter
         */
        public filter: SearchFilter;

        /**
         * The desired search facets for the request
         * @property {SearchFacets} facets
         */
        public facets: SearchFacets;

        /**
         * The desired search order by expressions for the request
         * @property {SearchOrderByExpression[]} orderBy
         */
        public orderBy: SearchOrderByExpression[];

        /**
         * Insider mode for on-boarding onto Alpha development
         * @property {string} insiderMode
         */
        public insiderMode: string;

        /**
         * Use a specific tenant
         * @property {string} tenant
         */
        public tenant: string;

        /**
         * Target a specific version
         * @property {string} version
         */
        public version: string;

        /**
         * The flights the call should use
         * @property {string[]} flights
         */
        public flights: string[];

        /**
         * The search id used to track the virtual session
         * @property {string} suggestId
         */
        public searchId: string;

        /**
         * The suggest id to correlate to the search
         * @property {string} suggestId
         */
        public suggestId: string;

        /**
         * The muid of the user.
         * @property {string} muid
         */
        public muid: string;

        /**
        * The API environment that should service the request
         * @property {string} environment
         */
        public environment: string;

        public constructor(
            query: string,
            httpMethod: HttpMethod = HttpMethod.GET,
            locale: string,
            scopes: string,
            count: number,
            skip: number,
            searchProvider: string,
            instantAnswerProvider: string,
            includeInstantAnswer: boolean,
            includeWebSearchResults: boolean,
            enableHitHighlights: boolean,
            filter: SearchFilter,
            facets: SearchFacets,
            orderBy: SearchOrderByExpression[],
            insiderMode: string,
            tenant: string,
            version: string,
            flights: string[],
            suggestId: string,
            muid: string,
            environment: string,
            searchId: string) {
            this.query = query;
            this.httpMethod = httpMethod;
            this.locale = locale;
            this.scopes = scopes;
            this.count = count;
            this.skip = skip;
            this.searchProvider = searchProvider;
            this.instantAnswerProvider = instantAnswerProvider;
            this.includeInstantAnswer = includeInstantAnswer;
            this.includeWebSearchResults = includeWebSearchResults;
            this.enableHitHighlights = enableHitHighlights;
            this.filter = filter;
            this.facets = facets;
            this.orderBy = orderBy;
            this.insiderMode = insiderMode;
            this.tenant = tenant;
            this.version = version;
            this.flights = flights;
            this.suggestId = suggestId;
            this.muid = muid;
            this.environment = environment;
            this.searchId = searchId;
        }
    }
}