示例#1
0
文件: Selector.cs 项目: sk81biz/sk81
        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;
 }
示例#3
0
文件: Selector.cs 项目: sk81biz/sk81
        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;
            });
        }
示例#4
0
文件: Selector.cs 项目: sk81biz/sk81
 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;
     });
 }