Documentation ¶
Index ¶
- func Index(link string, repliedToDocument *tgbotapi.Document, hashTag string)
- func IndexBulk(link string, fileName string, fileID string, hashTag string)
- func RemoveDocument(tag string, documentID string)
- func RemoveIndex(tag string)
- func Search(hashTag string, query string) []string
- type Document
- type Result
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Index ¶
Index function takes a telagram document, converts it to base64 and sends it to elasticsearch to index
func IndexBulk ¶
Index function takes a telagram document, converts it to base64 and sends it to elasticsearch to index
func RemoveDocument ¶
RemoveDocument removes a particular document from elasticsearch
func RemoveIndex ¶
func RemoveIndex(tag string)
RemoveIndex removes the entire index from elasticsearch
Types ¶
type Document ¶
type Document struct { FileID string `json:"fileID,omitempty"` Data string `json:"data,omitempty"` FileName string `json:"fileName"` }
Document represents an elasticsearch document
type Result ¶
type Result struct { Took int `json:"took"` TimedOut bool `json:"timed_out"` Shards struct { Total int `json:"total"` Successful int `json:"successful"` Skipped int `json:"skipped"` Failed int `json:"failed"` } `json:"_shards"` Hits struct { Total struct { Value int `json:"value"` Relation string `json:"relation"` } `json:"total"` MaxScore float64 `json:"max_score"` Hits []struct { Index string `json:"_index"` Type string `json:"_type"` ID string `json:"_id"` Score float64 `json:"_score"` Source struct { FileName string `json:"fileName"` FileID string `json:"fileID"` } `json:"_source"` } `json:"hits"` } `json:"hits"` }
Result is a representation of the ElasticSearch return
Click to show internal directories.
Click to hide internal directories.