Skip to content
Snippets Groups Projects

Resolve "Return unique id for search documents"

Merged Pieter van Staden requested to merge 22-search-return-unique-id into main
1 file
+ 4
3
Compare changes
  • Side-by-side
  • Inline
+ 4
3
@@ -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 {
Loading