Documentation
¶
Overview ¶
Package search provides SOSL search operations.
Index ¶
- type Builder
- func (b *Builder) Build() string
- func (b *Builder) In(scope string) *Builder
- func (b *Builder) Limit(limit int) *Builder
- func (b *Builder) Returning(objects ...string) *Builder
- func (b *Builder) ReturningWithFields(object string, fields ...string) *Builder
- func (b *Builder) WithDivision(division string) *Builder
- type DataCategory
- type HTTPClient
- type ParameterizedSearchRequest
- type Result
- type SObjSpec
- type SearchRecord
- type Service
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Builder ¶
type Builder struct {
// contains filtered or unexported fields
}
Builder provides fluent SOSL query building.
func NewBuilder ¶
NewBuilder creates a new SOSL query builder.
func (*Builder) ReturningWithFields ¶
ReturningWithFields adds object with specific fields.
func (*Builder) WithDivision ¶
WithDivision filters by division.
type DataCategory ¶
type DataCategory struct {
Group string `json:"groupName"`
Categories []string `json:"categories"`
}
DataCategory specifies a data category filter.
type HTTPClient ¶
type HTTPClient interface {
Get(ctx context.Context, path string) ([]byte, error)
Post(ctx context.Context, path string, body interface{}) ([]byte, error)
}
HTTPClient interface for dependency injection.
type ParameterizedSearchRequest ¶
type ParameterizedSearchRequest struct {
Query string `json:"q"`
Fields []string `json:"fields,omitempty"`
SObjects []SObjSpec `json:"sobjects,omitempty"`
In string `json:"in,omitempty"`
Limit int `json:"overallLimit,omitempty"`
DefaultLimit int `json:"defaultLimit,omitempty"`
DataCategories []DataCategory `json:"dataCategories,omitempty"`
}
ParameterizedSearchRequest contains parameterized search parameters.
type Result ¶
type Result struct {
SearchRecords []SearchRecord `json:"searchRecords"`
}
Result contains SOSL search results.
type SObjSpec ¶
type SObjSpec struct {
Name string `json:"name"`
Fields []string `json:"fields,omitempty"`
Limit int `json:"limit,omitempty"`
}
SObjSpec specifies search scope for an object.
type SearchRecord ¶
type SearchRecord struct {
Attributes map[string]interface{} `json:"attributes"`
ID string `json:"Id"`
Name string `json:"Name,omitempty"`
}
SearchRecord represents a search result record.
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
Service provides SOSL search operations.
func NewService ¶
func NewService(client HTTPClient, apiVersion string) *Service
NewService creates a new Search service.
func (*Service) Parameterized ¶
func (s *Service) Parameterized(ctx context.Context, req ParameterizedSearchRequest) (*Result, error)
Parameterized runs a parameterized search.