UNPKG

ravendb

Version:
76 lines 2.37 kB
import { AbstractIndexCreationTaskBase } from "../AbstractIndexCreationTaskBase.js"; import { SpatialOptionsFactory } from "../Spatial.js"; import { CONSTANTS } from "../../../Constants.js"; /** * Abstract class used to provide infrastructure service for actual creation tasks */ export class AbstractGenericTimeSeriesIndexCreationTask extends AbstractIndexCreationTaskBase { _reduce; _storesStrings; _indexesStrings; _analyzersStrings; _indexSuggestions; _termVectorsStrings; _spatialOptionsStrings; _vectorOptionsStrings; _outputReduceToCollection; _patternForOutputReduceToCollectionReferences; _patternReferencesCollectionName; constructor() { super(); this._storesStrings = {}; this._indexesStrings = {}; this._analyzersStrings = {}; this._indexSuggestions = new Set(); this._termVectorsStrings = {}; this._spatialOptionsStrings = {}; this._vectorOptionsStrings = {}; } /** * Gets a value indicating whether this instance is map reduce index definition */ get isMapReduce() { return !!this._reduce; } /** * Register a field to be indexed */ index(field, indexing) { this._indexesStrings[field] = indexing; } /** * Register a field to be spatially indexed */ spatial(field, indexing) { this._spatialOptionsStrings[field] = indexing(new SpatialOptionsFactory()); } // TBD protected void Store(Expression<Func<TReduceResult, object>> field, FieldStorage storage) storeAllFields(storage) { this._storesStrings[CONSTANTS.Documents.Indexing.Fields.ALL_FIELDS] = storage; } /** * Register a field to be stored */ store(field, storage) { this._storesStrings[field] = storage; } /** * Register a field to be analyzed */ analyze(field, analyzer) { this._analyzersStrings[field] = analyzer; } /** * Register a field to have term vectors */ termVector(field, termVector) { this._termVectorsStrings[field] = termVector; } suggestion(field) { this._indexSuggestions.add(field); } vectorField(field, vector) { this._vectorOptionsStrings[field] = vector; } } //# sourceMappingURL=AbstractGenericTimeSeriesIndexCreationTask.js.map