func (o *autoFacetOpt) setParams(params *pb.SearchParams) error { lim := int32(o.facetLimit) if lim == 0 { lim = defaultAutoFacetLimit } params.AutoDiscoverFacetCount = &lim if o.valueLimit > 0 { params.FacetAutoDetectParam = &pb.FacetAutoDetectParam{ ValueLimit: proto.Int32(int32(o.valueLimit)), } } return nil }