Example #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;
        }
Example #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);
 }
        public void TestFixtureSetUp()
        {
            index.Configuration
            .SetTypeResolver("type")
            .SetAreaResolver("area")
            .ForAll().SetIdentity("id");

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

            _driver = storageDriver;
            _index  = index;

            ClearFilesAndIndex();
        }
        //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));
        }
Example #7
0
 public virtual ISchemaCollection CreateSchemaCollection(IStorageIndex index)
 {
     return(new SchemaCollection());
 }
 public DefaultDocumentBuilder(IStorageIndex index, string contentType)
     : base(index, contentType)
 {
 }
 public MultiFieldQueryParser(IStorageIndex index, string query)
     : this(index, query, index.Schemas.AllFields().ToArray())
 {
 }
 public MultiFieldQueryParser(IStorageIndex index, string query, params string[] fields)
     : base(index.Version, null, index.Analyzer)
 {
     this.fields = fields;
     this.index  = index;
 }
Example #11
0
 public LuceneSearcher(IStorageIndex index)
     : this(index, new LuceneQueryBuilder(index))
 {
 }
Example #12
0
 public DefaultDocumentBuilderFactory(IStorageIndex index)
 {
     this.index = index;
 }
Example #13
0
 public TestIndexBuilder(IStorageIndex index)
 {
     this.index = index;
     index.Configuration.SetTypeResolver("contentType").ForAll().SetIdentity("id");
 }
Example #14
0
 public LuceneQueryBuilder(IStorageIndex index, IJObjectEnumarator enumarator)
 {
     this.index      = index;
     this.enumarator = enumarator;
 }
Example #15
0
 public FileService(IStorageIndex index, IStorageArea area)
 {
     this.index = index;
     this.area  = area;
 }
 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;
 }
Example #17
0
 public SearchService(IStorageIndex index, IPipeline pipeline, ILogger performance)
 {
     this.index       = index;
     this.pipeline    = pipeline;
     this.performance = performance;
 }
Example #18
0
 protected virtual void Configure(IStorageIndex index)
 {
 }
Example #19
0
 public DefaultDocumentFactory(IStorageIndex index)
     : this(index, new DefaultDocumentBuilderFactory(index), new JSchemaGenerator())
 {
 }
Example #20
0
 public virtual IDocumentFactory CreateDocumentFactory(IStorageIndex index)
 {
     return(new DefaultDocumentFactory(index));
 }
 //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))
 {
 }
Example #22
0
 public virtual ILuceneSearcher CreateSearcher(IStorageIndex index)
 {
     return(new LuceneSearcher(index));
 }
Example #23
0
 public SearchResultCollector(Query query, IStorageIndex index)
 {
     this.Query = query;
     this.index = index;
 }
Example #24
0
 public LuceneSearcher(IStorageIndex index, IQueryBuilder queryBuilder)
 {
     this.index        = index;
     this.queryBuilder = queryBuilder;
 }
Example #25
0
 protected virtual void Initialize(IStorageIndex index)
 {
 }
Example #26
0
 public LuceneQueryBuilder(IStorageIndex index)
     : this(index, new JObjectEnumerator())
 {
 }
Example #27
0
 public TermService(IStorageIndex index)
 {
     this.index = index;
 }
Example #28
0
 public FileServiceProvider(IStorageContext storage, IStorageIndex index)
     : base(name => new FileService(index, storage.Area(name)))
 {
 }
Example #29
0
 public void TestSetup()
 {
     _driver = Substitute.For <IStorageDriver>();
     _index  = Substitute.For <IStorageIndex>();
     _info   = new DataInfo("test data");
 }