Documentation
¶
Index ¶
- func AddFacetFilter(opts *Options, fieldName string, values []string)
- func BuildSearchRequest(opts *Options) components.SearchRequest
- func GetTimezoneOffset() int
- func RunSearch(ctx context.Context, opts *Options, sdk *glean.Glean, w io.Writer) error
- func RunSearchSDK(ctx context.Context, opts *Options, sdk *glean.Glean) (*components.SearchResponse, error)
- type FacetBucketFilter
- type FacetFilter
- type FacetFilterSet
- type FilterValue
- type Options
- type RequestOptions
- type RestrictionFilters
- type SearchInputDetails
- type SessionInfo
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddFacetFilter ¶
AddFacetFilter adds a facet filter to the search options
func BuildSearchRequest ¶
func BuildSearchRequest(opts *Options) components.SearchRequest
BuildSearchRequest converts Options into a components.SearchRequest without executing it. Used by --dry-run to show the exact request that would be sent.
func GetTimezoneOffset ¶
func GetTimezoneOffset() int
GetTimezoneOffset returns the current timezone offset in minutes
func RunSearchSDK ¶
func RunSearchSDK(ctx context.Context, opts *Options, sdk *glean.Glean) (*components.SearchResponse, error)
RunSearchSDK executes a search and returns the raw SDK response for the caller to format.
Types ¶
type FacetBucketFilter ¶
type FacetBucketFilter struct{}
type FacetFilter ¶
type FacetFilter struct {
FieldName string `json:"fieldName"`
Values []FilterValue `json:"values"`
}
type FacetFilterSet ¶
type FacetFilterSet struct {
Filters []FacetFilter `json:"filters"`
}
type FilterValue ¶
type Options ¶
type Options struct {
InputDetails *SearchInputDetails `json:"inputDetails,omitempty"`
SessionInfo *SessionInfo `json:"sessionInfo,omitempty"`
RequestOptions *RequestOptions `json:"requestOptions,omitempty"`
Query string `json:"query"`
Cursor string `json:"cursor,omitempty"`
Timestamp string `json:"timestamp,omitempty"`
TrackingToken string `json:"trackingToken,omitempty"`
ResultTabIds []string `json:"resultTabIds,omitempty"`
PageSize int `json:"pageSize,omitempty"`
MaxSnippetSize int `json:"maxSnippetSize,omitempty"`
TimeoutMillis int `json:"timeoutMillis,omitempty"`
DisableSpellcheck bool `json:"disableSpellcheck,omitempty"`
}
Options holds all CLI-level search options parsed from flags. These are mapped to the SDK's components.SearchRequest inside performSearch.
type RequestOptions ¶
type RequestOptions struct {
Exclusions *RestrictionFilters `json:"exclusions,omitempty"`
FacetBucketFilter *FacetBucketFilter `json:"facetBucketFilter,omitempty"`
Inclusions *RestrictionFilters `json:"inclusions,omitempty"`
DatasourceFilter string `json:"datasourceFilter,omitempty"`
FacetFilters []FacetFilter `json:"facetFilters,omitempty"`
FacetFilterSets []FacetFilterSet `json:"facetFilterSets,omitempty"`
ResponseHints []string `json:"responseHints,omitempty"`
DefaultFacets []string `json:"defaultFacets,omitempty"`
DatasourcesFilter []string `json:"datasourcesFilter,omitempty"`
FacetBucketSize int `json:"facetBucketSize"`
TimezoneOffset int `json:"timezoneOffset,omitempty"`
DisableQueryAutocorrect bool `json:"disableQueryAutocorrect,omitempty"`
DisableSpellcheck bool `json:"disableSpellcheck,omitempty"`
FetchAllDatasourceCounts bool `json:"fetchAllDatasourceCounts,omitempty"`
QueryOverridesFacetFilters bool `json:"queryOverridesFacetFilters,omitempty"`
ReturnLlmContentOverSnippets bool `json:"returnLlmContentOverSnippets,omitempty"`
}
type RestrictionFilters ¶
type RestrictionFilters struct{}
type SearchInputDetails ¶
type SearchInputDetails struct {
HasCopyPaste bool `json:"hasCopyPaste,omitempty"`
}
Click to show internal directories.
Click to hide internal directories.