File: src\internal\api\search\searchFacets.ts
/**
* @module API
* @submodule API Search
* @namespace api.search
*/
namespace internal.api.search {
/**
* Search api request facetable fields specification
* @class SearchFacets
*/
export class SearchFacets {
/**
* The document confidentiality facet to use when faceting results
* @property {SearchFacet} confidentiality
*/
public confidentiality?: SearchFacet;
/**
* The document content type facet to use when faceting results
* @property {SearchFacet} contentType
*/
public contentType?: SearchFacet;
/**
* The document language facet to use when faceting results
* @property {SearchFacet} language
*/
public language?: SearchFacet;
/**
* The document product family id facet to use when faceting results
* @property {SearchFacet} productFamilyId
*/
public productFamilyId?: SearchFacet;
/**
* The document product name id facet to use when faceting results
* @property {SearchFacet} productNameId
*/
public productNameId?: SearchFacet;
/**
* The document product version id facet to use when faceting results
* @property {SearchFacet} productFamilyId
*/
public productVersionId?: SearchFacet;
public constructor(
confidentialities?: SearchFacet,
contentType?: SearchFacet,
language?: SearchFacet,
productFamilyId?: SearchFacet,
productNameId?: SearchFacet,
productVersionId?: SearchFacet) {
this.confidentiality = confidentialities;
this.contentType = contentType;
this.language = language;
this.productFamilyId = productFamilyId;
this.productNameId = productNameId;
this.productVersionId = productVersionId;
}
}
/**
* A search request facet specification for a single field
* @class SearchFacet
*/
export class SearchFacet {
/**
* The max number of facet terms
* @property {number} count
*/
public count?: number;
/**
* The sort order for this facet
* @property {SearchFacetSortOrder} sort
*/
public sort?: SearchFacetSortOrder;
public constructor(
count?: number,
sort?: SearchFacetSortOrder) {
this.count = count;
this.sort = sort;
}
}
/**
* The facet sort order options enum
* @class SearchFacet
* @static
*/
export enum SearchFacetSortOrder {
/**
* Sort by the facet's count descending
* @property {string} CountDescending
*/
CountDescending = <any>"CountDescending",
/**
* Sort by the facet's count ascending
* @property {string} CountAscending
*/
CountAscending = <any>"CountAscending",
/**
* Sort by the facet's value descending
* @property {string} ValueDescending
*/
ValueDescending = <any>"ValueDescending",
/**
* Sort by the facet's value ascending
* @property {string} ValueAscending
*/
ValueAscending = <any>"ValueAscending",
}
}