Пример #1
0
        internal static FacetOptions Create(BlittableJsonReaderObject json)
        {
            var result = new FacetOptions();

            if (json.TryGet(nameof(result.TermSortMode), out string termSortMode))
            {
                result.TermSortMode = (FacetTermSortMode)Enum.Parse(typeof(FacetTermSortMode), termSortMode, ignoreCase: true);
            }

            if (json.TryGet(nameof(result.IncludeRemainingTerms), out bool includeRemainingTerms))
            {
                result.IncludeRemainingTerms = includeRemainingTerms;
            }

            if (json.TryGet(nameof(result.Start), out int start))
            {
                result.Start = start;
            }

            if (json.TryGet(nameof(result.PageSize), out int pageSize))
            {
                result.PageSize = pageSize;
            }

            return(result);
        }
Пример #2
0
 public IFacetOperations <T> WithOptions(FacetOptions options)
 {
     Facet.Options = options;
     return(this);
 }