Documentation ¶
Index ¶
- Variables
- type AlgoliaSearchConfig
- type SearchAlgolia
- func (s *SearchAlgolia) ConfigFields() []plugin.ConfigField
- func (s *SearchAlgolia) ConfigReceiver(config []byte) error
- func (s *SearchAlgolia) DeleteContent(ctx context.Context, contentID string) (err error)
- func (s *SearchAlgolia) Description() plugin.SearchDesc
- func (s *SearchAlgolia) Info() plugin.Info
- func (s *SearchAlgolia) RegisterSyncer(ctx context.Context, syncer plugin.SearchSyncer)
- func (s *SearchAlgolia) SearchAnswers(ctx context.Context, cond *plugin.SearchBasicCond) (res []plugin.SearchResult, total int64, err error)
- func (s *SearchAlgolia) SearchContents(ctx context.Context, cond *plugin.SearchBasicCond) (res []plugin.SearchResult, total int64, err error)
- func (s *SearchAlgolia) SearchQuestions(ctx context.Context, cond *plugin.SearchBasicCond) (res []plugin.SearchResult, total int64, err error)
- func (s *SearchAlgolia) UpdateContent(ctx context.Context, content *plugin.SearchContent) (err error)
Constants ¶
This section is empty.
Variables ¶
View Source
var ( NewestIndex = "newest" ActiveIndex = "active" ScoreIndex = "score" )
View Source
var AlgoliaSearchServerConfig = []byte(`
{
"minWordSizefor1Typo": 4,
"minWordSizefor2Typos": 8,
"hitsPerPage": 20,
"maxValuesPerFacet": 100,
"searchableAttributes": [
"content",
"title"
],
"numericAttributesToIndex": null,
"attributesToRetrieve": null,
"unretrievableAttributes": null,
"optionalWords": null,
"attributesForFaceting": [
"status",
"tags",
"type",
"user_id"
],
"attributesToSnippet": null,
"attributesToHighlight": null,
"paginationLimitedTo": 1000,
"attributeForDistinct": null,
"exactOnSingleWordQuery": "attribute",
"ranking": [
"desc(active)",
"desc(score)",
"desc(created)",
"typo",
"geo",
"words",
"filters",
"proximity",
"attribute",
"exact",
"custom"
],
"customRanking": [
"desc(title)",
"desc(content)"
],
"separatorsToIndex": "",
"removeWordsIfNoResults": "none",
"queryType": "prefixLast",
"highlightPreTag": "<em>",
"highlightPostTag": "</em>",
"alternativesAsExact": [
"ignorePlurals",
"singleWordSynonym"
]
}
`)
View Source
var Info embed.FS
Functions ¶
This section is empty.
Types ¶
type AlgoliaSearchConfig ¶
type SearchAlgolia ¶
type SearchAlgolia struct { Config *AlgoliaSearchConfig // contains filtered or unexported fields }
func (*SearchAlgolia) ConfigFields ¶
func (s *SearchAlgolia) ConfigFields() []plugin.ConfigField
ConfigFields return config fields
func (*SearchAlgolia) ConfigReceiver ¶
func (s *SearchAlgolia) ConfigReceiver(config []byte) error
ConfigReceiver receive config from admin
func (*SearchAlgolia) DeleteContent ¶
func (s *SearchAlgolia) DeleteContent(ctx context.Context, contentID string) (err error)
DeleteContent deletes the content
func (*SearchAlgolia) Description ¶
func (s *SearchAlgolia) Description() plugin.SearchDesc
func (*SearchAlgolia) Info ¶
func (s *SearchAlgolia) Info() plugin.Info
func (*SearchAlgolia) RegisterSyncer ¶
func (s *SearchAlgolia) RegisterSyncer(ctx context.Context, syncer plugin.SearchSyncer)
func (*SearchAlgolia) SearchAnswers ¶
func (s *SearchAlgolia) SearchAnswers(ctx context.Context, cond *plugin.SearchBasicCond) (res []plugin.SearchResult, total int64, err error)
func (*SearchAlgolia) SearchContents ¶
func (s *SearchAlgolia) SearchContents(ctx context.Context, cond *plugin.SearchBasicCond) (res []plugin.SearchResult, total int64, err error)
func (*SearchAlgolia) SearchQuestions ¶
func (s *SearchAlgolia) SearchQuestions(ctx context.Context, cond *plugin.SearchBasicCond) (res []plugin.SearchResult, total int64, err error)
func (*SearchAlgolia) UpdateContent ¶
func (s *SearchAlgolia) UpdateContent(ctx context.Context, content *plugin.SearchContent) (err error)
UpdateContent updates the content to algolia server
Source Files ¶
Click to show internal directories.
Click to hide internal directories.