meilisearch

package module
v1.2.9 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 7, 2025 License: Apache-2.0 Imports: 12 Imported by: 0

README

Meilisearch (preview)

Meilisearch is A lightning-fast search engine that fits effortlessly into your apps, websites, and workflow 🔍

How to use

Build
./answer build --with github.com/apache/answer-plugins/search-meilisearch
Configuration
  • Host - Meilisearch connection address, such as http://127.0.0.1:7700
  • ApiKey - Meilisearch api key
  • IndexName - The index answer will use. Default is answer_post
  • Async - Should answer use async mode to send data to Meilisearch. Default is false. use Async means you will not get any error message if Meilisearch task failed.

Documentation

Index

Constants

View Source
const (
	MaxGetPageSize = 1000
	MaxPutPerSize  = 100
)

Variables

View Source
var Info embed.FS

Functions

This section is empty.

Types

type Search struct {
	Config *SearchConfig
	Client *meilisearch.Client
	// contains filtered or unexported fields
}

func (*Search) ConfigFields

func (s *Search) ConfigFields() []plugin.ConfigField

func (*Search) ConfigReceiver

func (s *Search) ConfigReceiver(config []byte) error

func (*Search) DeleteContent

func (s *Search) DeleteContent(_ context.Context, contentID string) error

func (*Search) Description

func (s *Search) Description() plugin.SearchDesc

func (*Search) Info

func (s *Search) Info() plugin.Info

func (*Search) RegisterSyncer

func (s *Search) RegisterSyncer(ctx context.Context, syncer plugin.SearchSyncer)

func (*Search) SearchAnswers

func (s *Search) SearchAnswers(_ context.Context, cond *plugin.SearchBasicCond) (
	res []plugin.SearchResult, total int64, err error)

func (*Search) SearchContents

func (s *Search) SearchContents(_ context.Context, cond *plugin.SearchBasicCond) (
	res []plugin.SearchResult, total int64, err error)

func (*Search) SearchQuestions

func (s *Search) SearchQuestions(_ context.Context, cond *plugin.SearchBasicCond) (
	res []plugin.SearchResult, total int64, err error)

func (*Search) UpdateContent

func (s *Search) UpdateContent(_ context.Context, content *plugin.SearchContent) error

type SearchConfig

type SearchConfig struct {
	Host      string `json:"host"`
	ApiKey    string `json:"api_key"`
	IndexName string `json:"index_name"`
	Async     bool   `json:"async"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL