internal Func <SearchDescriptor <T>, ISearchRequest> GetDescriptor(BaseIndexer <T> indexer, bool onlyId = false) { return(s => { var result = s .Query(q => queryContainer) .Index(indexer.IndexName) .Sort(r => sortContainerDescriptor) .From(offset) .Size(limit); if (onlyId) { result = result.Source(r => r.Includes(a => a.Field("id"))); } return result; }); }
public FactoryIndexer( IOptionsMonitor <ILog> options, FactoryIndexerHelper factoryIndexerSupport, TenantManager tenantManager, SearchSettingsHelper searchSettingsHelper, FactoryIndexer factoryIndexer, BaseIndexer <T> baseIndexer, Client client, IServiceProvider serviceProvider) { Logger = options.Get("ASC.Indexer"); FactoryIndexerHelper = factoryIndexerSupport; TenantManager = tenantManager; SearchSettingsHelper = searchSettingsHelper; FactoryIndexerCommon = factoryIndexer; Indexer = baseIndexer; Client = client; ServiceProvider = serviceProvider; }
internal Func <UpdateByQueryDescriptor <T>, IUpdateByQueryRequest> GetDescriptorForUpdate(BaseIndexer <T> indexer, Func <ScriptDescriptor, IScript> script, bool immediately = true) { return(s => { var result = s .Query(q => queryContainer) .Index(indexer.IndexName) .Script(script); if (immediately) { result.Refresh(); } return result; }); }
internal Func <DeleteByQueryDescriptor <T>, IDeleteByQueryRequest> GetDescriptorForDelete(BaseIndexer <T> indexer, bool immediately = true) { return(s => { var result = s .Query(q => queryContainer) .Index(indexer.IndexName); if (immediately) { result.Refresh(); } return result; }); }