search-client
Version:
Javascript library for executing searches in the Haive search-index via the SearchManager REST interface.
50 lines • 2.41 kB
JavaScript
import { __extends } from "tslib";
import { BaseSettings } from '../Common';
import { QueryChangeSpecifications } from '../Common/QueryChangeSpecifications';
import { FindTriggers } from './FindTriggers';
/**
* These are all the settings that can affect the returned categories for Find() lookups.
*/
var FindSettings = /** @class */ (function (_super) {
__extends(FindSettings, _super);
/**
* Creates a FindSettings object for you, based on FindSettings defaults and the overrides provided as a param.
* @param settings - The settings defined here will override the default FindSettings.
*/
function FindSettings(settings) {
var _this = _super.call(this) // dummy (using init instead)
|| this;
// Setup settings object before calling super.init with it.
if (typeof settings === 'string') {
settings = { baseUrl: settings };
}
settings.servicePath =
typeof settings.servicePath !== 'undefined'
? settings.servicePath
: 'search/find';
_super.prototype.init.call(_this, settings);
// Setup our own stuff (props not in the base class).
_this.triggers = new FindTriggers(settings.triggers);
// A change in any of the defined fields should indicate that the results may have changed.
_this.queryChangeSpecs =
typeof settings.queryChangeSpecs !== 'undefined'
? settings.queryChangeSpecs
: QueryChangeSpecifications.clientId |
QueryChangeSpecifications.dateFrom |
QueryChangeSpecifications.dateTo |
QueryChangeSpecifications.filters |
QueryChangeSpecifications.matchGenerateContent |
QueryChangeSpecifications.matchGenerateContentHighlights |
QueryChangeSpecifications.matchGrouping |
QueryChangeSpecifications.matchOrderBy |
QueryChangeSpecifications.matchPage |
QueryChangeSpecifications.matchPageSize |
QueryChangeSpecifications.queryText |
QueryChangeSpecifications.searchType |
QueryChangeSpecifications.uiLanguageCode;
return _this;
}
return FindSettings;
}(BaseSettings));
export { FindSettings };
//# sourceMappingURL=FindSettings.js.map