public Search(ElasticClientProvider elastic) { client = elastic.Client; IndexName = elastic.Index; //var withMaxRecursionDescriptor = new CreateIndexDescriptor(elastic.Index) // .Mappings(ms => ms // .Map<T>(m => m.AutoMap(3)) // ); }
public void Delete <T>(string field, string value) where T : class { var response = ElasticClientProvider.GetClient().DeleteByQuery <T>(q => q .Index(NameExtractorService.ExtractName <T>()) .Query(qq => qq .Term($"{field}.keyword", value) ) ); response.Validate(); }
public IEnumerable <T> Search <T>(IFilterable filterable) where T : class { var filters = filterable.GetFilters(); var indexName = GetIndexName <T>(); var query = GenerateQueryDescriptor(filters); var response = ElasticClientProvider.GetClient().Search <T>(s => s .Index(indexName) .Query(q => query) .Size(5000)); response.Validate(); return(GetDocuments(response)); }
public BulkDataLoadRepository(IHostingEnvironment hostingEnvironment, IOptions <DataFileSettings> dataFileSettings, IOptions <ElasticConnectionSettings> esSettings, DataContext dataContext, ElasticClientProvider provider, ILogger <BulkDataLoadRepository> logger) { this.hostingEnvironment = hostingEnvironment; this.dataFileSettings = dataFileSettings; this.esSettings = esSettings; this.dataContext = dataContext; this.elasticClient = provider.Client; this.logger = logger; }
public async Task <SearchDTO> GetDocuments(DocumentSearchRequest searchRequest) { var elasticClient = ElasticClientProvider.GetElasticClient(); var searchResponse = await elasticClient.SearchAsync <Document>(s => s .Query(q => q .MultiMatch(c => c .Fields(f => f .Field(p => p.InvoiceNumber) .Field(p => p.InvoiceNumberReverse) .Field(p => p.SupplierName) .Field(p => p.CompanyName) .Field(p => p.OrganizationElementName)) .Query(searchRequest.SearchText) .Type(TextQueryType.PhrasePrefix) .Operator(Operator.Or)))); return(new SearchDTO { Documents = searchResponse.Documents.ToArray(), TotalCount = searchResponse.Total }); }
public SQLEsUserDriver(ElasticClientProvider provider) { _client = provider.Client; }
public SearchService(ElasticClientProvider provider, IMapper mapper) { _elasticClient = provider.Client; _mapper = mapper; }
public ReleaseRepository(ElasticClientProvider clientProvider) { _elasticClient = clientProvider.Client; }
public SearchElasticRepository(ElasticClientProvider provider, ILogger <SearchElasticRepository> logger, IMapper mapper) { this.elasticClient = provider.Client; this.logger = logger; this.mapper = mapper; }
public ReleaseByIdRepository(ElasticClientProvider clientProvider, IMapper mapper) { _elasticClient = clientProvider.Client; _mapper = mapper; }
public AutoCompleteService(ElasticClientProvider clientProvider) { _elasticClient = clientProvider.Client; }
public AutocompleteService(ElasticClientProvider provider) { _elasticClient = provider.Client; }
public IResponse SendBulk(IEnumerable <T> documents, string indexName) { var bulk = CreateBulkDescriptor(documents, indexName); return(ElasticClientProvider.GetClient().Bulk(bulk)); }
public SyncService(ElasticClientProvider provider, IMapper mapper, FoodLoversDbContext dbContext) { _elasticClient = provider.Client; _mapper = mapper; _dbContext = dbContext; }
private bool IsIndexExist(string indexName) { return(ElasticClientProvider.GetClient().Indices.Exists(indexName).Exists); }
public ArtistRepository(ElasticClientProvider clientProvider) { _elasticClient = clientProvider.Client; }
public IndexService(ElasticClientProvider esProvider) { _esProvider = esProvider; }
public UserSearchService(ElasticClientProvider provider, FriendyContext friendyContext) { _friendyContext = friendyContext; _client = provider.Client; }
public ArticleService(ElasticClientProvider esProvider) { _esProvider = esProvider; }
public SearchService(ElasticClientProvider clientProvider) { _client = clientProvider.Client; }
public SQL2Es(ElasticClientProvider provider) { _client = provider.Client; }
public LogViewRepository(IOptions <ElasticConnectionSettings> elasticSettings, ElasticClientProvider provider) { this.elasticClient = provider.Client; this.elasticSettings = elasticSettings; }
public IResponse CreateIndex(string indexName) { return(ElasticClientProvider.GetClient().Indices.Create(indexName)); }