Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
bobgroup-go-utils
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Bob Public Utils
bobgroup-go-utils
Merge requests
!14
Resolve "Return unique id for search documents"
Code
Review changes
Check out branch
Download
Patches
Plain diff
Expand sidebar
Merged
Resolve "Return unique id for search documents"
22-search-return-unique-id
into
main
Overview
0
Commits
3
Pipelines
0
Changes
1
Merged
Pieter van Staden
requested to merge
22-search-return-unique-id
into
main
3 years ago
Overview
0
Commits
3
Pipelines
0
Changes
1
Related to
#22 (closed)
0
0
Merge request reports
Viewing commit
b52cf3d7
Prev
Next
Show latest version
1 file
+
4
−
3
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
b52cf3d7
Update
· b52cf3d7
Jan Semmelink
authored
3 years ago
search/time_series.go
+
4
−
3
View file @ b52cf3d7
Edit in single-file editor
Open in Web IDE
Show full file
@@ -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
(
i
d
string
)
(
doc
interface
{},
err
error
)
{
func
(
ds
*
timeSeries
)
Get
(
i
ndexSlashDocumentID
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