public async Task <IEventIndexProcessor <TEvent> > AddAsync <TEvent, TSearchDocument>(
            Index index, IEventToSearchDocumentMapper <TEvent, TSearchDocument> mapper,
            IEnumerable <ITransactionHandler> functionHandlers = null) where TEvent : class, new() where TSearchDocument : class, new()
        {
            var indexer = await AzureSearchService.CreateEventIndexer(index, mapper);

            _indexers.Add(indexer);

            return(CreateProcessor(functionHandlers, indexer));
        }
Ejemplo n.º 2
0
        public static async Task <ILogsProcessorBuilder> AddToSearchIndexAsync <TEventDto, TSearchDocument>(
            this ILogsProcessorBuilder processorBuilder,
            string searchServiceName,
            string apiKey,
            Index azureIndex,
            IEventToSearchDocumentMapper <TEventDto, TSearchDocument> mapper,
            Predicate <EventLog <TEventDto> > predicate = null) where TEventDto : class, new() where TSearchDocument : class, new()
        {
            var searchService = processorBuilder.CreateAzureSearchServiceAndMarkForDisposal(searchServiceName, apiKey);

            return(await processorBuilder.AddToSearchIndexAsync(searchService, azureIndex, mapper, predicate).ConfigureAwait(false));
        }
Ejemplo n.º 3
0
        public static async Task <ILogsProcessorBuilder> AddToSearchIndexAsync <TEventDto, TSearchDocument>(
            this ILogsProcessorBuilder processorBuilder,
            IAzureSearchService azureSearchService,
            Index azureIndex,
            IEventToSearchDocumentMapper <TEventDto, TSearchDocument> mapper,
            Predicate <EventLog <TEventDto> > predicate = null) where TEventDto : class, new() where TSearchDocument : class, new()
        {
            var indexer = await azureSearchService.CreateEventIndexer(azureIndex, mapper).ConfigureAwait(false);

            processorBuilder.DisposeOnProcessorDisposing(indexer);
            return(processorBuilder.AddToSearchIndex(indexer, predicate));
        }
Ejemplo n.º 4
0
 public AzureEventIndexer(Index index, ISearchIndexClient indexClient, IEventToSearchDocumentMapper <TEvent, TSearchDocument> mapper) : base(index, indexClient)
 {
     _mapper = mapper;
 }
 public ElasticEventIndexer(IElasticClient client,
                            string indexName,
                            IEventToSearchDocumentMapper <TEvent, TSearchDocument> mapper) : base(client, indexName)
 {
     _mapper = mapper;
 }
        public async Task <IEventIndexer <TEvent> > CreateEventIndexer <TEvent, TSearchDocument>(Index index,
                                                                                                 IEventToSearchDocumentMapper <TEvent, TSearchDocument> mapper)
            where TEvent : class
            where TSearchDocument : class, new()
        {
            index = await GetOrCreateAzureIndex(index);

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

            return(indexer);
        }
        public async Task <IEventIndexer <TEvent> > CreateEventIndexer <TEvent, TSearchDocument>(string indexName, IEventToSearchDocumentMapper <TEvent, TSearchDocument> mapper)
            where TEvent : class
            where TSearchDocument : class, IHasId, new()
        {
            await CreateIfNotExists(indexName);

            var indexer =
                new ElasticEventIndexer <TEvent, TSearchDocument>(_elasticClient, indexName, mapper);

            return(indexer);
        }