/// <summary>
        /// Provide search with the specified query.
        /// </summary>
        /// <param name="options">The search options.</param>
        /// <returns>The search result.</returns>
        public virtual GridData Search(SearchOptions options)
        {
            var builder = new CatalogQueryBuilder();
              var query = builder.BuildQuery(options);
              var provider = new LuceneSearchProvider();

              return new ItemResultDataConverter().Convert(provider.Search(query), options.GridColumns);
        }
        /// <summary>
        /// Provide search with the specified query.
        /// </summary>
        /// <param name="options">The search options.</param>
        /// <returns>The search result.</returns>
        public virtual GridData Search(SearchOptions options)
        {
            var builder = new CatalogQueryBuilder();
              var query = builder.BuildQuery(options);

              var productRepository = Context.Entity.Resolve<IProductRepository>();
              var products = productRepository.Get<ProductBaseData, Query>(query);
              var productBaseDatas = products as ProductBaseData[] ?? products.ToArray();
              return productBaseDatas.IsNullOrEmpty() ? new GridData() : new EntityResultDataConverter<ProductBaseData>().Convert(productBaseDatas, options.GridColumns);
        }
        /// <summary>
        /// Provide search with the specified query.
        /// </summary>
        /// <param name="options">The search options.</param>
        /// <returns>The search result.</returns>
        public virtual GridData Search(SearchOptions options)
        {
            var builder = new CatalogQueryBuilder();
              var query = builder.BuildQuery(options);

              var orderManager = Context.Entity.Resolve<IOrderManager<Order>>();
              var orders = orderManager.GetOrders(query);

              var rules = new List<IMappingRule<Order>>();
              foreach (var order in orders)
              {
            var rule = Context.Entity.Resolve<IMappingRule<Order>>("OrderMappingRule");
            rule.MappingObject = order;
            rules.Add(rule);
              }

              return new EntityResultDataConverter<IMappingRule<Order>>().Convert(rules, options.GridColumns);
        }
        /// <summary>
        /// Builds the query.
        /// </summary>
        /// <param name="options">The options.</param>
        /// <returns>Returns Query</returns>
        public virtual Query BuildQuery(SearchOptions options)
        {
            this.SearchRoot = options.SearchRoot;

              this.AddSearchFields(options.SearchFields, QueryCondition.And);
              this.AddCheckboxes(options.Checklists, QueryCondition.And);
              this.AddTemplates(options.Templates, QueryCondition.And);

              return this.InnerBuilder;
        }