client/public/src/models/CollectionModel.js
/**
   * @method searchAggQuery
   * @description Performs asset type aggregation for a text query
   * @param {String} textQuery - A search phrase
   * @param {String} mainFacet  - An optional primary facet id
   * 
   * @returns {Promise}
   */
@method searchAggQuery
@description Performs asset type aggregation for a text query
@param {String} textQuery - A search phrase
@param {String} mainFacet  - An optional primary facet id

@returns {Promise}
@method searchAggQuery @description Performs asset type aggregation for a text query @param { String } textQuery - A search phrase @param { String } mainFacet - An optional primary facet id @returns { Promise }
async searchAggQuery(textQuery, mainFacet) {
    let q = QueryUtils.getBaseQueryObject();
    let id = textQuery;
    q.limit = 0;
    q.text = textQuery;
    q.textFields = AssetDefs.getSearchFields(mainFacet);
    q.facets = QueryUtils.defaultTypeFacet;
    let current = this.store.data.searchAggs[id];
    if ( current && current.request ) {
      await current.request;
    }
    else {
      await this.service.searchAgg(id, q);
    }
    return this.store.data.searchAggs[id];
  }
async searchAggQuery ( textQuery , mainFacet ) { let q = QueryUtils . getBaseQueryObject ( ) ; let id = textQuery ; q . limit = 0 ; q . text = textQuery ; q . textFields = AssetDefs . getSearchFields ( mainFacet ) ; q . facets = QueryUtils . defaultTypeFacet ; let current = this . store . data . searchAggs [ id ] ; if ( current && current . request ) { await current . request ; } else { await this . service . searchAgg ( id , q ) ; } return this . store . data . searchAggs [ id ] ; }
@method searchAggQuery
 @description Performs asset type aggregation for a text query
 @param {String} textQuery - A search phrase
 @param {String} mainFacet  - An optional primary facet id
@method searchAggQuery @description Performs asset type aggregation for a text query @param { String } textQuery - A search phrase @param { String } mainFacet - An optional primary facet id