Example #1
0
        public IIndexer <TransactionForFunctionVO <TFunctionMessage> > CreateIndexerForFunctionMessage <TFunctionMessage, TSearchDocument>(
            string indexName, Func <TransactionForFunctionVO <TFunctionMessage>, TSearchDocument> mapper, int documentsPerBatch)
            where TFunctionMessage : FunctionMessage, new() where TSearchDocument : class, IHasId
        {
            var indexer = new ElasticFunctionIndexer <TFunctionMessage, TSearchDocument>(indexName, _elasticClient, mapper, documentsPerBatch);

            _indexers.Add(indexer);
            return(indexer);
        }
        public async Task <IFunctionIndexer <TFunctionMessage> > CreateFunctionIndexer <TFunctionMessage>(FunctionIndexDefinition <TFunctionMessage> searchIndexDefinition) where TFunctionMessage : FunctionMessage, new()
        {
            await CreateIfNotExists(searchIndexDefinition);

            var indexer =
                new ElasticFunctionIndexer <TFunctionMessage>(_elasticClient, searchIndexDefinition);

            return(indexer);
        }
Example #3
0
        public IIndexer <TransactionForFunctionVO <TFunctionMessage> > CreateIndexerForFunctionMessage <TFunctionMessage>(
            string indexName, int documentsPerBatch)
            where TFunctionMessage : FunctionMessage, new()
        {
            var indexDefinition = new FunctionIndexDefinition <TFunctionMessage>(indexName);
            var indexer         = new ElasticFunctionIndexer <TFunctionMessage>(indexName, _elasticClient, indexDefinition, documentsPerBatch);

            _indexers.Add(indexer);
            return(indexer);
        }
        public async Task <IFunctionIndexer <TFunctionMessage> > CreateFunctionIndexer <TFunctionMessage, TSearchDocument>(string indexName, IFunctionMessageToSearchDocumentMapper <TFunctionMessage, TSearchDocument> mapper)
            where TFunctionMessage : FunctionMessage, new()
            where TSearchDocument : class, IHasId, new()
        {
            await CreateIfNotExists(indexName);

            var indexer =
                new ElasticFunctionIndexer <TFunctionMessage, TSearchDocument>(_elasticClient, indexName, mapper);

            return(indexer);
        }