TP-5555 | clean up job
This commit is contained in:
@@ -45,6 +45,13 @@ func (el *ElasticSearchClient) IndexDocument(document interface{}) {
|
||||
}
|
||||
}
|
||||
|
||||
func (el *ElasticSearchClient) DeleteDocuments(searchRequest string) {
|
||||
_, err := el.client.DeleteByQuery(el.Config.Index).Raw(strings.NewReader(searchRequest)).Do(context.TODO())
|
||||
if err != nil {
|
||||
log.Printf("unable to delete documents: %s", err.Error())
|
||||
}
|
||||
log.Printf("successfully deleted documents: %s", searchRequest)
|
||||
}
|
||||
func (el *ElasticSearchClient) SearchDocuments(searchRequest string, fields []string) ([]map[string]interface{}, map[string]interface{}, int64, error) {
|
||||
res, err := el.client.Search().
|
||||
Index(el.Config.Index).Raw(strings.NewReader(searchRequest)).
|
||||
|
||||
Reference in New Issue
Block a user