public DealController() { _commonRepository = new commonRepository(); _productRepository = new ProductRepository(); _dealRepository = new DealRepository(); _schemeRepository = new SchemeRepository(); }
/// <summary> /// Recupera o filtro dos parametros. /// </summary> /// <param name="filters"></param> /// <param name="schemeRepository"></param> /// <param name="analyzer"></param> /// <returns></returns> private static Filter GetFilter(FilterParameter[] filters, ISchemeRepository schemeRepository, StandardAnalyzer analyzer) { if (filters != null && filters.Length > 0) { return(new QueryWrapperFilter(GetQuery(filters, schemeRepository, analyzer))); } return(null); }
public LuceneSearcher(ISchemeRepository structRepository, IRepositoryLoader repositoryLoader, IDataRepository dataRepository, ISearchStatistics statisticsManager) { _structRepository = structRepository; _repositoryLoader = repositoryLoader; _dataRepository = dataRepository; _statisticsManager = statisticsManager; _syncService = new Colosoft.SearchEngine.Services.SyncSearchService(this); }
public OrderController() { _user = new UserMasterRepository(); _commonRepository = new commonRepository(); _dealRepository = new DealRepository(); _schemeRepository = new SchemeRepository(); _orderRepository = new OrderRepository(); _orderItemRepository = new OrderItemRepository(); }
/// <summary> /// Construtor padrĂ£o. /// </summary> /// <param name="query"></param> /// <param name="filter"></param> /// <param name="readerCreator"></param> /// <param name="sort"></param> /// <param name="options"></param> /// <param name="dataRepository"></param> /// <param name="structRepository"></param> /// <param name="loadedHandle"></param> internal SearchResult(global::Lucene.Net.Search.Query query, global::Lucene.Net.Search.Filter filter, Func <global::Lucene.Net.Index.IndexReader> readerCreator, global::Lucene.Net.Search.Sort sort, SearchOptions options, IDataRepository dataRepository, ISchemeRepository structRepository, EventHandler <SearchResultLoadEventArgs> loadedHandle) { _query = query; _filter = filter; _readerCreator = readerCreator; _sort = sort; _options = options; _dataRepository = dataRepository; _structRepository = structRepository; _loadedHandle = loadedHandle; }
public AccountController() { _user = new UserMasterRepository(); _commonRepository = new commonRepository(); _registrationRepository = new RegistrationRepository(); _dealRepository = new DealRepository(); _schemeRepository = new SchemeRepository(); _productCategoryRepository = new ProductCategoryRepository(); _productSubCategoryRepository = new ProductSubCategoryRepository(); _productRepository = new ProductRepository(); _licenceImagesReposiory = new LicenceImagesReposiory(); _orderRepository = new OrderRepository(); _orderItemRepository = new OrderItemRepository(); }
/// <summary> /// Recupera a consulta dos parametros informados. /// </summary> /// <param name="parameters"></param> /// <param name="analyzer"></param> /// <returns></returns> private static Query GetQuery(Parameter[] parameters, ISchemeRepository schemeRepository, global::Lucene.Net.Analysis.Analyzer analyzer) { if (parameters == null) { return(null); } var queries = new List <Query>(); foreach (var i in parameters.Distinct(new Parameter.NameEqualityComparer())) { var index = schemeRepository.GetSchemaIndex(i.Name); string parserValue = null; switch (i.SearchType) { case SearchType.Equal: parserValue = "\"" + GetParameterValue(i, index) + "\""; break; case SearchType.Like: parserValue = i.Value; break; case SearchType.Between: var betweenValues = GetParameterValues(i, index); parserValue = string.Format("[{0} TO {1}]", betweenValues[0], betweenValues[1]); break; case SearchType.In: parserValue = string.Join(" OR ", GetParameterValues(i, index)); break; case SearchType.Or: parserValue = string.Join(" OR ", GetParameterValues(i, index)); break; case SearchType.Greater: case SearchType.GreaterEqual: parserValue = string.Format("[{0} TO *]", GetParameterValue(i, index)); break; case SearchType.Less: case SearchType.LessEqual: parserValue = string.Format("[* TO {0}]", GetParameterValue(i, index)); break; default: throw new InvalidOperationException(string.Format("Invalid SearchParameterType ({0})", i.SearchType)); } var parser = new QueryParser(Version.LUCENE_29, i.Name, analyzer); queries.Add(parser.Parse(parserValue)); } if (queries.Count > 0) { var query = new global::Lucene.Net.Search.BooleanQuery(); foreach (var i in queries) { query.Add(new global::Lucene.Net.Search.BooleanClause(i, global::Lucene.Net.Search.BooleanClause.Occur.MUST)); } return(query); } return(null); }
public ApiDealController() { _dealRepository = new DealRepository(); _schemeRepository = new SchemeRepository(); }
public SchemeService() { _schemeRepo = new SchemeRepository(); }