github.com/altipla-consulting/ravendb-go-client@v0.1.3/facet_options.go (about)

     1  package ravendb
     2  
     3  import (
     4  	"math"
     5  	"unsafe"
     6  )
     7  
     8  var (
     9  	// DefaultFacetOptions are default facet options
    10  	DefaultFacetOptions = &FacetOptions{}
    11  )
    12  
    13  // FacetOptions describes options for facet
    14  type FacetOptions struct {
    15  	TermSortMode          FacetTermSortMode `json:"TermSortMode"`
    16  	IncludeRemainingTerms bool              `json:"IncludeRemainingTerms"`
    17  	Start                 int               `json:"Start"`
    18  	PageSize              int               `json:"PageSize"`
    19  }
    20  
    21  func maxInt() int {
    22  	if unsafe.Sizeof(int(0)) == unsafe.Sizeof(int32(0)) {
    23  		return int(math.MaxInt32)
    24  	}
    25  	return int(math.MaxInt64)
    26  }
    27  
    28  // NewFacetOptions returns new FacetOptions
    29  func NewFacetOptions() *FacetOptions {
    30  	return &FacetOptions{
    31  		PageSize: int(math.MaxInt32),
    32  	}
    33  }