Documentation ¶
Index ¶
- Constants
- type ESClient
- func (es *ESClient) BuildIndex(ctx context.Context, index, body string) error
- func (es *ESClient) Delete(ctx context.Context, id string) error
- func (es *ESClient) DeleteByQuery(ctx context.Context, query map[string]interface{}) error
- func (es *ESClient) Search(ctx context.Context, req SearchRequest) (SearchResponse, error)
- type SearchEngine
- type SearchRequest
- type SearchResponse
- type SelectDriveOption
- type Type
Constants ¶
View Source
const EntityIndex = "entity"
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ESClient ¶
type ESClient struct {
Client *elastic.Client
}
func (*ESClient) BuildIndex ¶
func (*ESClient) DeleteByQuery ¶
func (*ESClient) Search ¶
func (es *ESClient) Search(ctx context.Context, req SearchRequest) (SearchResponse, error)
type SearchEngine ¶
type SearchEngine interface { BuildIndex(ctx context.Context, index, content string) error Search(ctx context.Context, request SearchRequest) (SearchResponse, error) Delete(ctx context.Context, id string) error }
func NewElasticsearchEngine ¶
func NewElasticsearchEngine(cfg config.ESConfig) SearchEngine
type SearchRequest ¶
type SearchRequest struct { Source string `protobuf:"bytes,1,opt,name=source,proto3" json:"source,omitempty"` Owner string `protobuf:"bytes,2,opt,name=owner,proto3" json:"owner,omitempty"` Query string `protobuf:"bytes,3,opt,name=query,proto3" json:"query,omitempty"` Page *pb.Pager `protobuf:"bytes,4,opt,name=page,proto3" json:"page,omitempty"` Condition []*pb.SearchCondition `protobuf:"bytes,5,rep,name=condition,proto3" json:"condition,omitempty"` }
type SearchResponse ¶
type SelectDriveOption ¶
type SelectDriveOption func() Type
func Parse ¶
func Parse(drive string) SelectDriveOption
type Type ¶
type Type string
const ElasticsearchDriver Type = "elasticsearch"
func Elasticsearch ¶
func Elasticsearch() Type
func NoopDriver ¶
func NoopDriver() Type
Click to show internal directories.
Click to hide internal directories.