Exemple #1
0
        public IIndexer <EventLog <TEventDTO> > CreateIndexerForEventLog <TEventDTO>(
            string indexName, int documentsPerBatch = 1)
            where TEventDTO : class, IEventDTO, new()
        {
            var indexClient     = GetOrCreateIndexClient(indexName);
            var indexDefinition = new EventIndexDefinition <TEventDTO>(indexName);
            var azureIndexer    = new AzureEventIndexer <TEventDTO>(indexClient, indexDefinition, documentsPerBatch);

            _indexers.Add(azureIndexer);
            return(azureIndexer);
        }
Exemple #2
0
        public IIndexer <EventLog <TEventDTO> > CreateIndexerForEventLog <TEventDTO, TSearchDocument>(
            string indexName, Func <EventLog <TEventDTO>, TSearchDocument> mapper, int documentsPerBatch = 1)
            where TEventDTO : class, IEventDTO, new()
            where TSearchDocument : class, IHasId
        {
            var indexClient  = GetOrCreateIndexClient(indexName);
            var azureIndexer = new AzureEventIndexer <TEventDTO, TSearchDocument>(indexClient, mapper, documentsPerBatch);

            _indexers.Add(azureIndexer);
            return(azureIndexer);
        }
        public async Task <IEventIndexer <TEvent> > CreateEventIndexer <TEvent, TSearchDocument>(Index index, Func <EventLog <TEvent>, TSearchDocument> mappingFunc)
            where TEvent : class
            where TSearchDocument : class, new()
        {
            index = await GetOrCreateAzureIndex(index);

            var mapper = new EventToSearchDocumentMapper <TEvent, TSearchDocument>(mappingFunc);
            IEventIndexer <TEvent> indexer = new AzureEventIndexer <TEvent, TSearchDocument>(index, GetOrCreateIndexClient(index.Name), mapper);

            return(indexer);
        }