ravendb
Version:
RavenDB client for Node.js
80 lines • 2.66 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.AbstractGenericTimeSeriesIndexCreationTask = void 0;
const AbstractIndexCreationTaskBase_js_1 = require("../AbstractIndexCreationTaskBase.js");
const Spatial_js_1 = require("../Spatial.js");
const Constants_js_1 = require("../../../Constants.js");
/**
* Abstract class used to provide infrastructure service for actual creation tasks
*/
class AbstractGenericTimeSeriesIndexCreationTask extends AbstractIndexCreationTaskBase_js_1.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 Spatial_js_1.SpatialOptionsFactory());
}
// TBD protected void Store(Expression<Func<TReduceResult, object>> field, FieldStorage storage)
storeAllFields(storage) {
this._storesStrings[Constants_js_1.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;
}
}
exports.AbstractGenericTimeSeriesIndexCreationTask = AbstractGenericTimeSeriesIndexCreationTask;
//# sourceMappingURL=AbstractGenericTimeSeriesIndexCreationTask.js.map