UNPKG

@configurator/ravendb

Version:
50 lines 1.86 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.AbstractGenericIndexCreationTask = void 0; const AbstractIndexCreationTaskBase_1 = require("./AbstractIndexCreationTaskBase"); const Spatial_1 = require("./Spatial"); const Constants_1 = require("../../Constants"); const Exceptions_1 = require("../../Exceptions"); class AbstractGenericIndexCreationTask extends AbstractIndexCreationTaskBase_1.AbstractIndexCreationTaskBase { constructor() { super(); this.storesStrings = {}; this.indexesStrings = {}; this.analyzersStrings = {}; this.indexSuggestions = new Set(); this.termVectorsStrings = {}; this.spatialOptionsStrings = {}; } index(field, indexing) { this.indexesStrings[field] = indexing; } spatial(field, indexing) { this.spatialOptionsStrings[field] = indexing(new Spatial_1.SpatialOptionsFactory()); } storeAllFields(storage) { this.storesStrings[Constants_1.CONSTANTS.Documents.Indexing.Fields.ALL_FIELDS] = storage; } store(field, storage) { this.storesStrings[field] = storage; } analyze(field, analyzer) { this.analyzersStrings[field] = analyzer; } termVector(field, termVector) { this.termVectorsStrings[field] = termVector; } suggestion(field) { this.indexSuggestions.add(field); } addAssembly(assembly) { if (!assembly) { (0, Exceptions_1.throwError)("InvalidArgumentException", "Assembly cannot be null"); } if (!this.additionalAssemblies) { this.additionalAssemblies = []; } this.additionalAssemblies.push(assembly); } } exports.AbstractGenericIndexCreationTask = AbstractGenericIndexCreationTask; //# sourceMappingURL=AbstractGenericIndexCreationTask.js.map