Documentation
¶
Index ¶
- func AddSearchBoxToCache(searchbox SearchBoxESModel)
- func DeleteSearchBoxToCache(id string)
- func GetCachedSearchBoxes(filterHidden bool, filterEnabled bool) map[string]SearchBoxESModel
- func GetFeaturedSuggestions(query *querytranslate.Query, value string) ([]querytranslate.SuggestionHIT, error)
- func MapToString(m interface{}) *string
- func SetCachedSearchBoxes(searchBoxes []SearchBoxESModel)
- type DocumentPreferences
- type ESFeaturedSuggestionDoc
- type Endpoint
- type EndpointPreferences
- type Error
- type ExportAs
- type ExportSettings
- type ExportType
- type FacetSettings
- type FeaturedPreferences
- type FeaturedSuggestionsCacheSyncScript
- type FeaturedSuggestionsConfig
- func (featuredSuggestionsConfig *FeaturedSuggestionsConfig) DeleteFeaturedSuggestions(searchboxId string, idsToDelete *[]string) error
- func (featuredSuggestionsConfig *FeaturedSuggestionsConfig) GetFeaturedSuggestions(groupId string) ([]ESFeaturedSuggestionDoc, error)
- func (featuredSuggestionsConfig *FeaturedSuggestionsConfig) SearchFeaturedSuggestions(groupId string, value string) ([]ESFeaturedSuggestionDoc, error)
- func (featuredSuggestionsConfig *FeaturedSuggestionsConfig) UpdateFeaturedSuggestions(searchboxId string, featuredSuggestions []ESFeaturedSuggestionDoc) error
- type FusionSettings
- type GlobalSettings
- type Layout
- type PreferenceType
- type PutObjectToBucketRequest
- type RSThemeConfig
- type RecommendationPreference
- type RecommendationPreferenceRequest
- type RecommendationSettings
- type RecommendationsPreferences
- type ResultSettings
- type SearchBoxESFeaturedSuggestionDoc
- type SearchBoxESModel
- type SearchBoxPreference
- type SearchPreference
- type SearchPreferenceRequest
- type SearchPreferences
- type SearchSettings
- type SectionInfo
- type StaticFilterType
- type ThemeColors
- type ThemeSettings
- type ThemeTypography
- type UIBuilder
- type UIBuilderPreferencesMigration
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddSearchBoxToCache ¶
func AddSearchBoxToCache(searchbox SearchBoxESModel)
func DeleteSearchBoxToCache ¶
func DeleteSearchBoxToCache(id string)
func GetCachedSearchBoxes ¶
func GetCachedSearchBoxes(filterHidden bool, filterEnabled bool) map[string]SearchBoxESModel
To retrieve the cached searchboxes
func GetFeaturedSuggestions ¶
func GetFeaturedSuggestions(query *querytranslate.Query, value string) ([]querytranslate.SuggestionHIT, error)
Returns the featured suggestions
func MapToString ¶
func MapToString(m interface{}) *string
func SetCachedSearchBoxes ¶
func SetCachedSearchBoxes(searchBoxes []SearchBoxESModel)
Types ¶
type DocumentPreferences ¶
type ESFeaturedSuggestionDoc ¶
type ESFeaturedSuggestionDoc struct {
Label string `json:"label,omitempty"`
Value string `json:"value,omitempty"`
Description *string `json:"description,omitempty"`
Action *querytranslate.ActionType `json:"action,omitempty"`
SearchboxId *string `json:"searchboxId,omitempty"`
Id *string `json:"id,omitempty"`
SubAction *string `json:"subAction,omitempty"`
SectionId *string `json:"sectionId,omitempty"`
SectionLabel *string `json:"sectionLabel,omitempty"`
Icon *string `json:"icon,omitempty"`
IconURL *string `json:"iconURL,omitempty"`
Score *float64 `json:"_score,omitempty"`
Order *int `json:"order,omitempty"`
}
Featured suggestion document stored in ES
type Endpoint ¶
type Endpoint struct {
URL *string `json:"url,omitempty"`
Method *string `json:"method,omitempty"`
HeadersMap *map[string]string `json:"headers,omitempty"`
BodyMap *interface{} `json:"body,omitempty"`
Headers *string `json:"headers_string,omitempty"`
Body *string `json:"body_string,omitempty"`
IsUsingStringFormat bool `json:"is_using_string_format,omitempty"`
}
Endpoint struct
type EndpointPreferences ¶
type EndpointPreferences struct {
SectionLabel *string `json:"sectionLabel,omitempty"`
Endpoint *Endpoint `json:"endpoint,omitempty"`
TransformResponse *string `json:"transformResponse,omitempty"`
ShowDistinctSuggestions *bool `json:"showDistinctSuggestions,omitempty"`
EnablePredictiveSuggestions *bool `json:"enablePredictiveSuggestions,omitempty"`
MaxPredictedWords *int `json:"maxPredictedWords,omitempty"`
ApplyStopwords *bool `json:"applyStopwords,omitempty"`
CustomStopwords *[]string `json:"customStopwords,omitempty"`
EnableSynonyms *bool `json:"enableSynonyms,omitempty"`
IncludeFields *[]string `json:"includeFields,omitempty"`
ExcludeFields *[]string `json:"excludeFields,omitempty"`
URLField *string `json:"urlField,omitempty"`
}
type ExportAs ¶
type ExportAs int
func (ExportAs) MarshalJSON ¶
MarshalJSON is the implementation of the Marshaler interface for marshaling ExportAs type.
func (ExportAs) String ¶
String is the implementation of Stringer interface that returns the string representation of ExportAs type.
func (*ExportAs) UnmarshalJSON ¶
UnmarshalJSON is the implementation of the Unmarshaler interface for unmarshaling ExportAs type.
type ExportSettings ¶
type ExportSettings struct {
ExportType *ExportType `json:"type"`
OpenAsPage bool `json:"openAsPage"`
Credentials string `json:"credentials"`
ExportAs *ExportAs `json:"exportAs"`
Meta map[string]interface{} `json:"meta,omitempty"`
}
type ExportType ¶
type ExportType int
const ( Other ExportType = iota Shopify )
func (ExportType) MarshalJSON ¶
func (o ExportType) MarshalJSON() ([]byte, error)
MarshalJSON is the implementation of the Marshaler interface for marshaling SortBy type.
func (ExportType) String ¶
func (o ExportType) String() string
String is the implementation of Stringer interface that returns the string representation of ExportType type.
func (*ExportType) UnmarshalJSON ¶
func (o *ExportType) UnmarshalJSON(bytes []byte) error
UnmarshalJSON is the implementation of the Unmarshaler interface for unmarshaling ExportType type.
type FacetSettings ¶
type FacetSettings struct {
StaticFacets []struct {
Name *StaticFilterType `json:"name"`
Enabled bool `json:"enabled"`
IsCollapsible bool `json:"isCollapsible"`
CustomMessages struct {
Loading string `json:"loading"`
NoResults string `json:"noResults"`
} `json:"customMessages"`
RSConfig map[string]interface{} `json:"rsConfig"`
} `json:"staticFacets"`
DynamicFacets []struct {
Enabled bool `json:"enabled"`
CustomMessages struct {
Loading string `json:"loading"`
NoResults string `json:"noResults"`
} `json:"customMessages"`
RSConfig map[string]interface{} `json:"rsConfig"`
} `json:"dynamicFacets"`
Meta map[string]interface{} `json:"meta,omitempty"`
}
type FeaturedPreferences ¶
type FeaturedSuggestionsCacheSyncScript ¶
type FeaturedSuggestionsCacheSyncScript struct {
// contains filtered or unexported fields
}
func (FeaturedSuggestionsCacheSyncScript) Index ¶
func (s FeaturedSuggestionsCacheSyncScript) Index() string
func (FeaturedSuggestionsCacheSyncScript) PluginName ¶
func (s FeaturedSuggestionsCacheSyncScript) PluginName() string
func (FeaturedSuggestionsCacheSyncScript) SetCache ¶
func (s FeaturedSuggestionsCacheSyncScript) SetCache(response *elastic.SearchResult) error
type FeaturedSuggestionsConfig ¶
type FeaturedSuggestionsConfig struct {
// contains filtered or unexported fields
}
func (*FeaturedSuggestionsConfig) DeleteFeaturedSuggestions ¶
func (featuredSuggestionsConfig *FeaturedSuggestionsConfig) DeleteFeaturedSuggestions(searchboxId string, idsToDelete *[]string) error
func (*FeaturedSuggestionsConfig) GetFeaturedSuggestions ¶
func (featuredSuggestionsConfig *FeaturedSuggestionsConfig) GetFeaturedSuggestions(groupId string) ([]ESFeaturedSuggestionDoc, error)
Get saved featured suggestions
func (*FeaturedSuggestionsConfig) SearchFeaturedSuggestions ¶
func (featuredSuggestionsConfig *FeaturedSuggestionsConfig) SearchFeaturedSuggestions(groupId string, value string) ([]ESFeaturedSuggestionDoc, error)
Returns the matched featured suggestions by value
func (*FeaturedSuggestionsConfig) UpdateFeaturedSuggestions ¶
func (featuredSuggestionsConfig *FeaturedSuggestionsConfig) UpdateFeaturedSuggestions(searchboxId string, featuredSuggestions []ESFeaturedSuggestionDoc) error
Update the featured suggestions in ES index
type FusionSettings ¶
type GlobalSettings ¶
type Layout ¶
type Layout struct {
Sections []SectionInfo `json:"sections,omitempty"`
MaxSuggestionsPerSection *int `json:"maxSuggestionsPerSection,omitempty"`
SectionsOrder *[]string `json:"sectionsOrder,omitempty"`
}
type PreferenceType ¶
type PreferenceType int
const ( Search PreferenceType = iota Recommendation )
func (PreferenceType) MarshalJSON ¶
func (o PreferenceType) MarshalJSON() ([]byte, error)
MarshalJSON is the implementation of the Marshaler interface for marshaling PreferenceType type.
func (PreferenceType) String ¶
func (o PreferenceType) String() string
String is the implementation of Stringer interface that returns the string representation of PreferenceType type.
func (*PreferenceType) UnmarshalJSON ¶
func (o *PreferenceType) UnmarshalJSON(bytes []byte) error
UnmarshalJSON is the implementation of the Unmarshaler interface for unmarshaling PreferenceType type.
type RSThemeConfig ¶
type RSThemeConfig struct {
Colors ThemeColors `json:"colors"`
Typography ThemeTypography `json:"typography"`
}
type RecommendationPreference ¶
type RecommendationPreference struct {
ID string `json:"id"`
Name string `json:"name"`
Description string `json:"description"`
Pipeline string `json:"pipeline"`
Type PreferenceType `json:"type"`
DeploySettings map[string]interface{} `json:"deploySettings"`
ThemeSettings *ThemeSettings `json:"themeSettings,omitempty"`
GlobalSettings *GlobalSettings `json:"globalSettings,omitempty"`
ResultSettings *ResultSettings `json:"resultSettings,omitempty"`
ExportSettings *ExportSettings `json:"exportSettings,omitempty"`
RecommendationSettings *RecommendationSettings `json:"recommendationSettings,omitempty"`
UpdatedAt *int64 `json:"updated_at,omitempty"`
CreatedAt *int64 `json:"created_at,omitempty"`
}
type RecommendationPreferenceRequest ¶
type RecommendationPreferenceRequest struct {
ID string `json:"id"`
Name string `json:"name"`
Description string `json:"description"`
Pipeline string `json:"pipeline"`
Type PreferenceType `json:"type"`
DeploySettings map[string]interface{} `json:"deploySettings"`
ThemeSettings *ThemeSettings `json:"themeSettings,omitempty"`
GlobalSettings *GlobalSettings `json:"globalSettings,omitempty"`
ResultSettings *ResultSettings `json:"resultSettings,omitempty"`
ExportSettings *ExportSettings `json:"exportSettings,omitempty"`
RecommendationSettings *RecommendationSettings `json:"recommendationSettings,omitempty"`
}
type RecommendationSettings ¶
type RecommendationSettings struct {
CtaTitle string `json:"ctaTitle"`
CtaAction string `json:"ctaAction"`
Recommendations []struct {
ID string `json:"id"`
Title string `json:"title"`
Type string `json:"type"`
MaxProducts int64 `json:"maxProducts"`
ProductsPageUrl *string `json:"productsPageUrl,omitempty"`
DataField *string `json:"dataField,omitempty"`
DocIds *[]string `json:"docIds,omitempty"`
} `json:"recommendations"`
Meta map[string]interface{} `json:"meta,omitempty"`
}
type RecommendationsPreferences ¶
type RecommendationsPreferences struct {
ThemeSettings *ThemeSettings `json:"themeSettings,omitempty"`
GlobalSettings *GlobalSettings `json:"globalSettings,omitempty"`
ResultSettings *ResultSettings `json:"resultSettings,omitempty"`
ExportSettings *ExportSettings `json:"exportSettings,omitempty"`
RecommendationSettings *RecommendationSettings `json:"recommendationSettings,omitempty"`
}
type ResultSettings ¶
type ResultSettings struct {
Fields struct {
Title string `json:"title"`
Description string `json:"description"`
Price string `json:"price"`
Image string `json:"image"`
Handle string `json:"handle"`
} `json:"fields"`
CustomMessages struct {
ResultStats string `json:"resultStats"`
NoResults string `json:"noResults"`
} `json:"customMessages"`
RSConfig map[string]interface{} `json:"rsConfig"`
ViewSwitcher bool `json:"viewSwitcher"`
Layout string `json:"layout"`
Meta map[string]interface{} `json:"meta,omitempty"`
ResultHighlight bool `json:"resultHighlight,omitempty"`
MapLayout string `json:"mapLayout,omitempty"`
MapComponent string `json:"mapComponent,omitempty"`
DefaultZoom int32 `json:"defaultZoom,omitempty"`
ShowSearchAsMove bool `json:"showSearchAsMove"`
ShowMarkerClusters bool `json:"showMarkerClusters"`
MapsAPIKey string `json:"mapsAPIkey,omitempty"`
LocationDataField string `json:"locationDataField,omitempty"`
}
type SearchBoxESFeaturedSuggestionDoc ¶
type SearchBoxESFeaturedSuggestionDoc struct {
Label string `json:"label,omitempty"`
Value string `json:"value,omitempty"`
Description *string `json:"description,omitempty"`
Action *querytranslate.ActionType `json:"action,omitempty"`
Id *string `json:"id,omitempty"`
SubAction *string `json:"subAction,omitempty"`
Icon *string `json:"icon,omitempty"`
IconURL *string `json:"iconURL,omitempty"`
}
Featured suggestion document stored in ES
type SearchBoxESModel ¶
type SearchBoxESModel struct {
Id *string `json:"id,omitempty"`
Description *string `json:"description,omitempty"`
Enabled *bool `json:"enabled,omitempty"`
Hidden *bool `json:"hidden,omitempty"`
SearchBox *SearchBoxPreference `json:"searchbox,omitempty"`
CreatedAt *int64 `json:"created_at,omitempty"`
UpdatedAt *int64 `json:"updated_at,omitempty"`
}
func GetCachedSearchBox ¶
func GetCachedSearchBox(id string) *SearchBoxESModel
To retrieve the cached searchbox
type SearchBoxPreference ¶
type SearchBoxPreference struct {
Popular *querytranslate.PopularSuggestionsOptions `json:"popular,omitempty"`
Recent *querytranslate.RecentSuggestionsOptions `json:"recent,omitempty"`
Endpoint *EndpointPreferences `json:"endpoint,omitempty"`
Featured *FeaturedPreferences `json:"featured,omitempty"`
Document *DocumentPreferences `json:"document,omitempty"`
FAQ *map[string]string `json:"faq,omitempty"`
}
type SearchPreference ¶
type SearchPreference struct {
ID string `json:"id"`
Name string `json:"name"`
Description string `json:"description"`
Pipeline string `json:"pipeline"`
UpdatedAt *int64 `json:"updated_at,omitempty"`
CreatedAt *int64 `json:"created_at,omitempty"`
Type PreferenceType `json:"type"`
// New fields to store settings as string
FusionSettings *string `json:"fusionSettings_string,omitempty"`
DeploySettings *string `json:"deploySettings_string,omitempty"`
AuthenticationSettings *string `json:"authenticationSettings_string,omitempty"`
PageSettings *string `json:"pageSettings_string,omitempty"`
ComponentSettings *string `json:"componentSettings_string,omitempty"`
ThemeSettings *string `json:"themeSettings_string,omitempty"`
GlobalSettings *string `json:"globalSettings_string,omitempty"`
ResultSettings *string `json:"resultSettings_string,omitempty"`
ExportSettings *string `json:"exportSettings_string,omitempty"`
SearchSettings *string `json:"searchSettings_string,omitempty"`
FacetSettings *string `json:"facetSettings_string,omitempty"`
SyncSettings *string `json:"syncSettings_string,omitempty"`
// Older fields
FusionSettingsStruct *FusionSettings `json:"fusionSettings"`
DeploySettingsStruct *map[string]interface{} `json:"deploySettings,omitempty"`
AuthenticationSettingsStruct *map[string]interface{} `json:"authenticationSettings,omitempty"`
PageSettingsStruct *map[string]interface{} `json:"pageSettings,omitempty"`
ComponentSettingsStruct *map[string]interface{} `json:"componentSettings,omitempty"`
ThemeSettingsStruct *ThemeSettings `json:"themeSettings,omitempty"`
GlobalSettingsStruct *GlobalSettings `json:"globalSettings,omitempty"`
ResultSettingsStruct *ResultSettings `json:"resultSettings,omitempty"`
ExportSettingsStruct *ExportSettings `json:"exportSettings,omitempty"`
SearchSettingsStruct *SearchSettings `json:"searchSettings,omitempty"`
FacetSettingsStruct *FacetSettings `json:"facetSettings,omitempty"`
SyncSettingsStruct *map[string]interface{} `json:"syncSettings"`
// To track if using new fields
IsUsingStringFields bool `json:"isUsingStringFields"`
}
type SearchPreferenceRequest ¶
type SearchPreferenceRequest struct {
ID string `json:"id"`
Name string `json:"name"`
Description string `json:"description"`
Pipeline string `json:"pipeline"`
Type PreferenceType `json:"type"`
DeploySettings map[string]interface{} `json:"deploySettings"`
AuthenticationSettings map[string]interface{} `json:"authenticationSettings,omitempty"`
ThemeSettings *ThemeSettings `json:"themeSettings,omitempty"`
FusionSettings *FusionSettings `json:"fusionSettings,omitempty"`
PageSettings map[string]interface{} `json:"pageSettings,omitempty"`
ComponentSettings map[string]interface{} `json:"componentSettings,omitempty"`
GlobalSettings *GlobalSettings `json:"globalSettings,omitempty"`
ResultSettings *ResultSettings `json:"resultSettings,omitempty"`
ExportSettings *ExportSettings `json:"exportSettings,omitempty"`
SearchSettings *SearchSettings `json:"searchSettings,omitempty"`
FacetSettings *FacetSettings `json:"facetSettings,omitempty"`
SyncSettings map[string]interface{} `json:"syncSettings"`
}
type SearchPreferences ¶
type SearchPreferences struct {
ThemeSettings *ThemeSettings `json:"themeSettings,omitempty"`
FusionSettings *FusionSettings `json:"fusionSettings,omitempty"`
PageSettings map[string]interface{} `json:"pageSettings,omitempty"`
ComponentSettings map[string]interface{} `json:"componentSettings,omitempty"`
GlobalSettings *GlobalSettings `json:"globalSettings,omitempty"`
ResultSettings *ResultSettings `json:"resultSettings,omitempty"`
ExportSettings *ExportSettings `json:"exportSettings,omitempty"`
SearchSettings *SearchSettings `json:"searchSettings,omitempty"`
FacetSettings *FacetSettings `json:"facetSettings,omitempty"`
SyncSettings map[string]interface{} `json:"syncSettings"`
}
type SearchSettings ¶
type SearchSettings struct {
// To override the fields to display suggestions
// We don't support this in UI right now
Fields struct {
Title string `json:"title"`
Description string `json:"description"`
Price string `json:"price"`
Image string `json:"image"`
Handle string `json:"handle"`
} `json:"fields"`
CustomMessages struct {
NoResults string `json:"noResults"`
} `json:"customMessages"`
RSConfig map[string]interface{} `json:"rsConfig"`
SearchButton struct {
Icon string `json:"icon"`
Text string `json:"text"`
} `json:"searchButton"`
RedirectURLIcon string `json:"redirectUrlIcon,omitempty"`
RedirectURLText string `json:"redirectUrlText,omitempty"`
Meta map[string]interface{} `json:"meta,omitempty"`
}
type SectionInfo ¶
type SectionInfo struct {
Id *string `json:"id,omitempty"`
Label *string `json:"label,omitempty"`
Suggestions []SearchBoxESFeaturedSuggestionDoc `json:"suggestions,omitempty"`
}
type StaticFilterType ¶
type StaticFilterType int
const ( ProductType StaticFilterType = iota Collection Color Size Price )
func (StaticFilterType) MarshalJSON ¶
func (o StaticFilterType) MarshalJSON() ([]byte, error)
MarshalJSON is the implementation of the Marshaler interface for marshaling SortBy type.
func (StaticFilterType) String ¶
func (o StaticFilterType) String() string
String is the implementation of Stringer interface that returns the string representation of StaticFilterType type.
func (*StaticFilterType) UnmarshalJSON ¶
func (o *StaticFilterType) UnmarshalJSON(bytes []byte) error
UnmarshalJSON is the implementation of the Unmarshaler interface for unmarshaling StaticFilterType type.
type ThemeColors ¶
type ThemeSettings ¶
type ThemeSettings struct {
Type string `json:"type"`
RSConfig RSThemeConfig `json:"rsConfig"`
CustomCSS string `json:"customCss"`
Meta map[string]interface{} `json:"meta,omitempty"`
}
type ThemeTypography ¶
type ThemeTypography struct {
FontFamily string `json:"fontFamily"`
}
type UIBuilder ¶
type UIBuilder struct {
// contains filtered or unexported fields
}
func Instance ¶
func Instance() *UIBuilder
Instance returns the singleton instance of Logs plugin. Note: Only this function must be used (both within and outside the package) to obtain the instance Logs in order to avoid stateless instances of the plugin.
func (*UIBuilder) AlternateRoutes ¶
Expose plugin specific routes
func (*UIBuilder) ESMiddleware ¶
func (p *UIBuilder) ESMiddleware() []middleware.Middleware
ESMiddleware is a default empty middleware function
func (*UIBuilder) InitFunc ¶
InitFunc is a part of Plugin interface that gets executed only once, and initializes the dao, i.e. elasticsearch before the plugin is operational.
func (*UIBuilder) RSMiddleware ¶
func (p *UIBuilder) RSMiddleware() []middleware.Middleware
RSMiddleware is a default empty middleware function
type UIBuilderPreferencesMigration ¶
type UIBuilderPreferencesMigration struct {
// contains filtered or unexported fields
}
func (UIBuilderPreferencesMigration) ConditionCheck ¶
func (m UIBuilderPreferencesMigration) ConditionCheck() (bool, *util.Error)
func (UIBuilderPreferencesMigration) IsAsync ¶
func (m UIBuilderPreferencesMigration) IsAsync() bool
func (UIBuilderPreferencesMigration) Script ¶
func (m UIBuilderPreferencesMigration) Script() *util.Error