Ejemplo n.º 1
0
        /// <summary>
        /// Gets a <see cref="T:FacetSpec"/> by field name.
        /// <see cref="T:FacetSpec"/> specifies how facets are to be returned on the <see cref="T:BrowseResult"/>.
        /// </summary>
        /// <param name="name">field name</param>
        /// <returns>facet spec</returns>
        public virtual FacetSpec GetFacetSpec(string name)
        {
            FacetSpec result;

            FacetSpecs.TryGetValue(name, out result);
            return(result);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Gets a string representation of the current request.
        /// </summary>
        /// <returns></returns>
        public override string ToString()
        {
            StringBuilder buf = new StringBuilder();

            buf.Append("query: ").Append(Query).AppendLine();
            buf.Append("page: [").Append(Offset).Append(',').Append(Count).Append("]").AppendLine();
            buf.Append("sort spec: ").Append(m_sortSpecs.ToDisplayString()).AppendLine();
            buf.Append("selections: ").Append(m_selections.ToDisplayString()).AppendLine();
            buf.Append("facet spec: ").Append(FacetSpecs.ToDisplayString()).AppendLine();
            buf.Append("fetch stored fields: ").Append(FetchStoredFields).AppendLine();
            buf.Append("group by: ").Append((GroupBy != null) ? string.Join(",", GroupBy) : string.Empty);
            return(buf.ToString());
        }
Ejemplo n.º 3
0
 /// <summary>
 /// Sets a <see cref="T:FacetSpec"/> and its related field name.
 /// <see cref="T:FacetSpec"/> specifies how facets are to be returned on the <see cref="T:BrowseResult"/>.
 /// </summary>
 /// <param name="name">field name</param>
 /// <param name="facetSpec">Facet spec</param>
 public virtual void SetFacetSpec(string name, FacetSpec facetSpec)
 {
     FacetSpecs.Add(name, facetSpec);
 }