Documentation
¶
Index ¶
- type Field
- type FieldMeta
- type FieldType
- type IndexMeta
- type PageSearchResult
- type SearchEngine
- func (this *SearchEngine) BeginSafeFlush(name string)
- func (this *SearchEngine) CreateIndex(name string) *searchIndex
- func (this *SearchEngine) EndSafeFlush(name string)
- func (this *SearchEngine) Fetch(name, id string) *SourceObject
- func (this *SearchEngine) FetchByPage(request string, page int64) *PageSearchResult
- func (this *SearchEngine) FlushIndex(name string)
- func (this *SearchEngine) Init(context *bingo.ApplicationContext)
- func (this *SearchEngine) LoadSource(name string, obj *SourceObject)
- func (this *SearchEngine) RemoveBySearch(name string, input ...Field)
- func (this *SearchEngine) RemoveKeyword(name, field, word string)
- func (this *SearchEngine) RemoveSource(name string, obj *SourceObject)
- func (this *SearchEngine) Search(name string, input ...Field) *PageSearchResult
- type SourceObject
- type TargetObject
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type PageSearchResult ¶
type PageSearchResult struct {
Id string `json:"uuid"` //查询的请求id
Index int64 `json:"page"` //页码
Data []TargetObject
}
type SearchEngine ¶
type SearchEngine struct {
// contains filtered or unexported fields
}
func (*SearchEngine) BeginSafeFlush ¶
func (this *SearchEngine) BeginSafeFlush(name string)
开始安全flush
func (*SearchEngine) CreateIndex ¶
func (this *SearchEngine) CreateIndex(name string) *searchIndex
创建索引
func (*SearchEngine) EndSafeFlush ¶
func (this *SearchEngine) EndSafeFlush(name string)
结束安全flush,自动替换掉查询用的索引
func (*SearchEngine) Fetch ¶
func (this *SearchEngine) Fetch(name, id string) *SourceObject
func (*SearchEngine) FetchByPage ¶
func (this *SearchEngine) FetchByPage(request string, page int64) *PageSearchResult
按页获取数据
func (*SearchEngine) Init ¶
func (this *SearchEngine) Init(context *bingo.ApplicationContext)
func (*SearchEngine) LoadSource ¶
func (this *SearchEngine) LoadSource(name string, obj *SourceObject)
加载和刷新数据
func (*SearchEngine) RemoveBySearch ¶
func (this *SearchEngine) RemoveBySearch(name string, input ...Field)
根据查询条件删除数据,只支持单个条件很正向条件的索引字段删除,数据删除支持搜索删除
func (*SearchEngine) RemoveKeyword ¶
func (this *SearchEngine) RemoveKeyword(name, field, word string)
删除索引中的某个词条
func (*SearchEngine) RemoveSource ¶
func (this *SearchEngine) RemoveSource(name string, obj *SourceObject)
删除数据
func (*SearchEngine) Search ¶
func (this *SearchEngine) Search(name string, input ...Field) *PageSearchResult
type SourceObject ¶
type SourceObject struct {
TargetObject
Fields map[string][]string `json:"fields"`
}
type TargetObject ¶
type TargetObject struct {
Id string `json:"id"`
Data json.RawMessage `json:"data"`
}
Click to show internal directories.
Click to hide internal directories.