Exemple #1
0
        public void AddColumn(string column)
        {
            bool addIt = false;

            if (rbDataFields.Checked)
            {
                if (!DataFields.Any(x => x.ColumnName.Equals(column)))
                {
                    DataFields.Add(new DataField(column));
                    addIt = true;
                }
            }
            else
            {
                if (!SearchFields.Any(x => x.Equals(column)))
                {
                    SearchFields.Add(new SearchField(column, GetCurrentLogic()));
                    addIt = true;
                }
            }

            if (addIt)
            {
                chkSelection.Items.Add(column);
            }
        }
Exemple #2
0
        private IEnumerable <QueryOption> GetAllOptions()
        {
            if (Filter != null)
            {
                yield return(new QueryOption("$filter", Uri.EscapeDataString(Filter)));
            }

            if (HighlightPreTag != null)
            {
                yield return(new QueryOption("highlightPreTag", Uri.EscapeDataString(HighlightPreTag)));
            }

            if (HighlightPostTag != null)
            {
                yield return(new QueryOption("highlightPostTag", Uri.EscapeDataString(HighlightPostTag)));
            }

            if (MinimumCoverage != null)
            {
                yield return(new QueryOption("minimumCoverage", MinimumCoverage.ToString()));
            }

            if (OrderBy.Any())
            {
                yield return(new QueryOption("$orderby", OrderBy));
            }

            if (SearchFields.Any())
            {
                yield return(new QueryOption("searchFields", SearchFields));
            }

            if (Select.Any())
            {
                yield return(new QueryOption("$select", Select));
            }
            else
            {
                yield return(new QueryOption("$select", "*"));
            }

            if (Top != null)
            {
                yield return(new QueryOption("$top", Top.ToString()));
            }

            yield return(new QueryOption("fuzzy", UseFuzzyMatching.ToString().ToLowerInvariant()));
        }
        private IEnumerable <QueryOption> GetAllOptions()
        {
            yield return(new QueryOption("$count", IncludeTotalResultCount.ToString().ToLowerInvariant()));

            foreach (string facetExpr in Facets)
            {
                yield return(new QueryOption("facet", Uri.EscapeDataString(facetExpr)));
            }

            if (Filter != null)
            {
                yield return(new QueryOption("$filter", Uri.EscapeDataString(Filter)));
            }

            if (HighlightFields.Any())
            {
                yield return(new QueryOption("highlight", HighlightFields));
            }

            if (HighlightPreTag != null)
            {
                yield return(new QueryOption("highlightPreTag", Uri.EscapeDataString(HighlightPreTag)));
            }

            if (HighlightPostTag != null)
            {
                yield return(new QueryOption("highlightPostTag", Uri.EscapeDataString(HighlightPostTag)));
            }

            if (MinimumCoverage != null)
            {
                yield return(new QueryOption("minimumCoverage", MinimumCoverage.ToString()));
            }

            if (OrderBy.Any())
            {
                yield return(new QueryOption("$orderby", OrderBy));
            }

            foreach (string scoringParameterExpr in ScoringParameters)
            {
                yield return(new QueryOption("scoringParameter", scoringParameterExpr));
            }

            if (ScoringProfile != null)
            {
                yield return(new QueryOption("scoringProfile", ScoringProfile));
            }

            if (SearchFields.Any())
            {
                yield return(new QueryOption("searchFields", SearchFields));
            }

            yield return(new QueryOption("searchMode", SearchIndexClient.SearchModeToString(SearchMode)));

            if (Select.Any())
            {
                yield return(new QueryOption("$select", Select));
            }

            if (Skip != null)
            {
                yield return(new QueryOption("$skip", Skip.ToString()));
            }

            if (Top != null)
            {
                yield return(new QueryOption("$top", Top.ToString()));
            }
        }
        private IEnumerable <QueryOption> GetAllOptions()
        {
            yield return(new QueryOption("$count", IncludeTotalResultCount.ToString().ToLowerInvariant()));

            foreach (string facetExpr in Facets ?? Empty)
            {
                yield return(new QueryOption("facet", Uri.EscapeDataString(facetExpr)));
            }

            if (Filter != null)
            {
                yield return(new QueryOption("$filter", Uri.EscapeDataString(Filter)));
            }

            if (HighlightFields != null && HighlightFields.Any())
            {
                yield return(new QueryOption("highlight", HighlightFields));
            }

            if (HighlightPreTag != null)
            {
                yield return(new QueryOption("highlightPreTag", Uri.EscapeDataString(HighlightPreTag)));
            }

            if (HighlightPostTag != null)
            {
                yield return(new QueryOption("highlightPostTag", Uri.EscapeDataString(HighlightPostTag)));
            }

            if (MinimumCoverage != null)
            {
                yield return(new QueryOption("minimumCoverage", MinimumCoverage.ToString()));
            }

            if (OrderBy != null && OrderBy.Any())
            {
                yield return(new QueryOption("$orderby", OrderBy));
            }

            yield return(new QueryOption("queryType", (QueryType == Models.QueryType.Simple) ? "simple" : "full"));

            foreach (string scoringParameterExpr in ScoringParameterStrings)
            {
                yield return(new QueryOption("scoringParameter", scoringParameterExpr));
            }

            if (ScoringProfile != null)
            {
                yield return(new QueryOption("scoringProfile", ScoringProfile));
            }

            if (SearchFields != null && SearchFields.Any())
            {
                yield return(new QueryOption("searchFields", SearchFields));
            }

            yield return(new QueryOption("searchMode", (SearchMode == Models.SearchMode.Any) ? "any" : "all"));

            if (Select != null && Select.Any())
            {
                yield return(new QueryOption("$select", Select));
            }

            if (Skip != null)
            {
                yield return(new QueryOption("$skip", Skip.ToString()));
            }

            if (Top != null)
            {
                yield return(new QueryOption("$top", Top.ToString()));
            }
        }