search-client
Version:
Javascript library for executing searches in the Haive search-index via the SearchManager REST interface.
37 lines • 1.65 kB
JavaScript
import { __extends } from "tslib";
import { BaseQueryConverter } from '../Common';
/**
* Class to handle creating find lookups.
*/
var FindQueryConverter = /** @class */ (function (_super) {
__extends(FindQueryConverter, _super);
function FindQueryConverter() {
return _super !== null && _super.apply(this, arguments) || this;
}
/**
* Converts the query params to an array of key=value segments.
*/
FindQueryConverter.prototype.getUrlParams = function (query) {
var params = [];
this.addParamIfSet(params, 'c', query.clientId);
this.addParamIfSet(params, 'df', this.createDate(query.dateFrom));
this.addParamIfSet(params, 'dt', this.createDate(query.dateTo));
var filters = query.filters.map(function (f) {
return f.category.categoryName.join('|');
});
this.addParamIfSet(params, 'f', filters.join(';'));
this.addParamIfSet(params, 'q', query.queryText);
this.addParamIfSet(params, 't', query.searchType);
this.addParamIfSet(params, 'l', query.uiLanguageCode);
this.addParamIfSet(params, 'g', query.matchGrouping);
this.addParamIfSet(params, 'o', query.matchOrderBy);
this.addParamIfSet(params, 'p', query.matchPage);
this.addParamIfSet(params, 's', query.matchPageSize);
this.addParamIfSet(params, 'gc', query.matchGenerateContent);
this.addParamIfSet(params, 'gch', query.matchGenerateContentHighlights);
return params;
};
return FindQueryConverter;
}(BaseQueryConverter));
export { FindQueryConverter };
//# sourceMappingURL=FindQueryConverter.js.map