Exemplo n.º 1
0
 public DefaultDocumentFactory(IStorageIndex index, IDocumentBuilderFactory factory, IJSchemaGenerator generator)
 {
     this.index      = index;
     this.factory    = factory;
     this.generator  = generator;
     this.serializer = index.Configuration.Serializer;
 }
        protected AbstractDocumentBuilder(IStorageIndex index, string contentType)
        {
            this.contentType = contentType;
            Document         = new Document();

            configuration = index.Configuration;
        }
Exemplo n.º 3
0
 public ContentService(IStorageIndex index, IStorageArea area, IStorageIndexManager manager, IPipeline pipeline, IJsonMergeVisitor merger, ILogger performance)
 {
     this.index       = index;
     this.area        = area;
     this.manager     = manager;
     this.pipeline    = pipeline;
     this.performance = performance;
     this.merger      = new ContentMergeService(merger, area);
 }
Exemplo n.º 4
0
        public void TestFixtureSetUp()
        {
            index.Configuration
            .SetTypeResolver("type")
            .SetAreaResolver("area")
            .ForAll().SetIdentity("id");

            index = TestObjects(1000).Aggregate(
                index, (idx, json) => idx.Write(json));
        }
Exemplo n.º 5
0
        public XmlStorage(IStorageDriver storageDriver, IStorageIndex index)
        {
            storageDriver.ThrowIfNull(nameof(storageDriver));
            index.ThrowIfNull(nameof(index));

            _driver = storageDriver;
            _index  = index;

            ClearFilesAndIndex();
        }
Exemplo n.º 6
0
        //TODO: To many dependencies, refactor!
        public StorageIndexManager(IStorageIndex index, IStorageContext storage, IWebHostConfiguration configuration, IWebScheduler scheduler, IInitializationTracker tracker, IDiagnosticsLogger logger)
        {
            this.index     = index;
            this.debugging = configuration.Index.Debugging;
            if (this.debugging)
            {
                this.index.Writer.InfoEvent += (sender, args) => logger.Log("indexdebug", Severity.Critical, args.Message, new { args });
            }
            this.scheduler = scheduler;
            this.tracker   = tracker;
            this.logger    = logger;
            interval       = TimeSpan.FromSeconds(configuration.Index.Watch.Interval);

            if (!string.IsNullOrEmpty(configuration.Index.Watch.RamBuffer))
            {
                buffer = (int)AdvConvert.ConvertToByteCount(configuration.Index.Watch.RamBuffer) / (1024 * 1024);
            }

            watchers = configuration.Index.Watch.Items
                       .ToDictionary(we => we.Area, we => (IStorageIndexChangeLogWatcher)
                                     new StorageChangeLogWatcher(we.Area, storage.Area(we.Area).Log, we.BatchSize < 1 ? configuration.Index.Watch.BatchSize : we.BatchSize, logger, InfoStream));
        }
Exemplo n.º 7
0
 public virtual ISchemaCollection CreateSchemaCollection(IStorageIndex index)
 {
     return(new SchemaCollection());
 }
Exemplo n.º 8
0
 public DefaultDocumentBuilder(IStorageIndex index, string contentType)
     : base(index, contentType)
 {
 }
Exemplo n.º 9
0
 public MultiFieldQueryParser(IStorageIndex index, string query)
     : this(index, query, index.Schemas.AllFields().ToArray())
 {
 }
Exemplo n.º 10
0
 public MultiFieldQueryParser(IStorageIndex index, string query, params string[] fields)
     : base(index.Version, null, index.Analyzer)
 {
     this.fields = fields;
     this.index  = index;
 }
Exemplo n.º 11
0
 public LuceneSearcher(IStorageIndex index)
     : this(index, new LuceneQueryBuilder(index))
 {
 }
Exemplo n.º 12
0
 public DefaultDocumentBuilderFactory(IStorageIndex index)
 {
     this.index = index;
 }
Exemplo n.º 13
0
 public TestIndexBuilder(IStorageIndex index)
 {
     this.index = index;
     index.Configuration.SetTypeResolver("contentType").ForAll().SetIdentity("id");
 }
Exemplo n.º 14
0
 public LuceneQueryBuilder(IStorageIndex index, IJObjectEnumarator enumarator)
 {
     this.index      = index;
     this.enumarator = enumarator;
 }
Exemplo n.º 15
0
 public FileService(IStorageIndex index, IStorageArea area)
 {
     this.index = index;
     this.area  = area;
 }
Exemplo n.º 16
0
 public ContentServiceProvider(IStorageIndex index, IStorageContext context, IStorageIndexManager manager, IPipeline pipeline, IJsonMergeVisitor merger, ILogger performance)
     : base(name => new ContentService(index, context.Area(name), manager, pipeline, merger, performance))
 {
     this.context = context;
 }
Exemplo n.º 17
0
 public SearchService(IStorageIndex index, IPipeline pipeline, ILogger performance)
 {
     this.index       = index;
     this.pipeline    = pipeline;
     this.performance = performance;
 }
Exemplo n.º 18
0
 protected virtual void Configure(IStorageIndex index)
 {
 }
Exemplo n.º 19
0
 public DefaultDocumentFactory(IStorageIndex index)
     : this(index, new DefaultDocumentBuilderFactory(index), new JSchemaGenerator())
 {
 }
Exemplo n.º 20
0
 public virtual IDocumentFactory CreateDocumentFactory(IStorageIndex index)
 {
     return(new DefaultDocumentFactory(index));
 }
Exemplo n.º 21
0
 //TODO: Currently there is only one index, in the future we might wan't to make a mapping between areas and multiple indexes.
 //      or alternatively switch to a 1:1 strategy where we then just have to perform multiple searches if we wish to lookup across.
 public SearchServiceProvider(IStorageIndex index, IPipeline pipeline, ILogger performance)
     : base(name => new SearchService(index, pipeline, performance))
 {
 }
Exemplo n.º 22
0
 public virtual ILuceneSearcher CreateSearcher(IStorageIndex index)
 {
     return(new LuceneSearcher(index));
 }
Exemplo n.º 23
0
 public SearchResultCollector(Query query, IStorageIndex index)
 {
     this.Query = query;
     this.index = index;
 }
Exemplo n.º 24
0
 public LuceneSearcher(IStorageIndex index, IQueryBuilder queryBuilder)
 {
     this.index        = index;
     this.queryBuilder = queryBuilder;
 }
Exemplo n.º 25
0
 protected virtual void Initialize(IStorageIndex index)
 {
 }
Exemplo n.º 26
0
 public LuceneQueryBuilder(IStorageIndex index)
     : this(index, new JObjectEnumerator())
 {
 }
Exemplo n.º 27
0
 public TermService(IStorageIndex index)
 {
     this.index = index;
 }
Exemplo n.º 28
0
 public FileServiceProvider(IStorageContext storage, IStorageIndex index)
     : base(name => new FileService(index, storage.Area(name)))
 {
 }
Exemplo n.º 29
0
 public void TestSetup()
 {
     _driver = Substitute.For <IStorageDriver>();
     _index  = Substitute.For <IStorageIndex>();
     _info   = new DataInfo("test data");
 }