protected void Query(string text, int start, string loggingId = null, FilterQueryCollection filterQueries = null, bool hideSuggestions = false)
        {
            if (text == null) text = txtSearch.Text.Trim();

            phSearchResults.Visible = true;
            lblQuery.Text = text;
            lblQueryNoResults.Text = text;

            FacetAndFilter.FilterDataSource = filterQueries;
            FacetAndFilter.DataBind();

            var search = new Search<MyResult>(new Settings(COLLECTION));
            QueryOptions options = new QueryOptions()
            {
                Highlighting = true,
                Start = start,
                Rows = ROWS,
                SpellCheck = true,
                FacetFields = new[] { "url", "title" },
                FilterQueries = filterQueries,
                LoggingId = loggingId,
                // Language = "en" });
            };
            var cpResults = search.Execute(text, options);

            phSearchResultsNoResults.Visible = cpResults.Count == 0 && (filterQueries == null || filterQueries.Count == 0);
            phSearchResultsResults.Visible = !phSearchResultsNoResults.Visible;

            lblCount.Text = cpResults.TotalCount.ToString();
            lblFrom.Text = (start + 1).ToString();
            lblTo.Text = (start + cpResults.Count).ToString();
            phResultFromTo.Visible = start + cpResults.Count > 1;

            phSuggestions.Visible = (cpResults.Suggestions.Count > 0 && cpResults.Start == 0 && !hideSuggestions);
            if (cpResults.Suggestions.Count > 0)
            {
                lbSuggestionCollation.Text = cpResults.Suggestions.Collation;
                lbSuggestionCollation.CommandArgument = cpResults.Suggestions.Collation;
            }

            if (cpResults.Facets != null && cpResults.Facets.Count > 0)
            {
                FacetAndFilter.FacetDataSource = cpResults.Facets;
                FacetAndFilter.DataBind();
            }

            var pages = Enumerable.Range(1, (int) Math.Ceiling((double) cpResults.TotalCount/ROWS));
            rptPager.LoggingId = "";
            if (cpResults.CrownPeak != null && cpResults.CrownPeak.Logging != null)
            {
                rptPager.LoggingId = cpResults.CrownPeak.Logging.Id;
            }
            rptPager.DataSource = pages;
            rptPager.DataBind();
            rptPager.Visible = cpResults.TotalCount > ROWS;

            rptResults.DataSource = cpResults;
            rptResults.DataBind();
        }
        protected void Query(string text, int start, FilterQueryCollection filterQueries = null)
        {
            var search = new Search<MyResult>(new Settings("www.crownpeak.com"));
            QueryOptions options = new QueryOptions()
            {
                Highlighting = false,
                Start = 0,
                Rows = 100000,
                SpellCheck = false,
                OrderBy = new[] { new SortOrder("date", CrownPeak.SearchG2.Query.SortDirection.Desc) },
                // Language = "en"
            };
            var cpResults = search.Execute(text, options);

            rptItems.DataSource = cpResults;
            rptItems.DataBind();
        }