diff --git a/search/time_series.go b/search/time_series.go index 1928432032cc2b53f6a987e49e4c82902e2c1df7..c819fb9978d94213bc590af53deab1baec942f85 100644 --- a/search/time_series.go +++ b/search/time_series.go @@ -472,14 +472,15 @@ func (ts *timeSeries) Search(query Query, limit int64) (docs map[string]interfac return docs, hitsTotalValue.Interface().(int), nil } -func (ds *timeSeries) Get(id string) (doc interface{}, err error) { +func (ds *timeSeries) Get(indexSlashDocumentID string) (doc interface{}, err error) { if ds == nil { return nil, errors.Errorf("document store == nil") } + parts := strings.SplitN(indexSlashDocumentID, "/", 2) get := opensearchapi.GetRequest{ - Index: ds.name, + Index: parts[0], DocumentType: "_doc", - DocumentID: id, + DocumentID: parts[1], } getResponse, err := get.Do(context.Background(), ds.w.client) if err != nil {