Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
I
Indexer
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
OSDU
OSDU Data Platform
System
Indexer
Commits
38f9d3a9
Commit
38f9d3a9
authored
2 years ago
by
MZhu9
Browse files
Options
Downloads
Patches
Plain Diff
index normalizedKind attribute under tags for all records
parent
f9bb517c
No related branches found
No related tags found
1 merge request
!456
index normalizedKind attribute under tags for all records
Pipeline
#157937
passed with warnings
2 years ago
Stage: review
Stage: build
Stage: coverage
Stage: containerize
Stage: scan
Stage: deploy
Stage: integration
Changes
1
Pipelines
3
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
indexer-core/src/main/java/org/opengroup/osdu/indexer/service/IndexerServiceImpl.java
+9
-2
9 additions, 2 deletions
...rg/opengroup/osdu/indexer/service/IndexerServiceImpl.java
with
9 additions
and
2 deletions
indexer-core/src/main/java/org/opengroup/osdu/indexer/service/IndexerServiceImpl.java
+
9
−
2
View file @
38f9d3a9
...
...
@@ -70,6 +70,9 @@ public class IndexerServiceImpl implements IndexerService {
private
final
Gson
gson
=
new
GsonBuilder
().
serializeNulls
().
create
();
// we index a normalized kind (authority + source + entity type + major version) as a tags attribute for all records
private
static
String
NORMALIZATION_KIND_TAG_ATTRIBUTE_NAME
=
"normalizedKind"
;
@Inject
private
JaxRsDpsLog
jaxRsDpsLog
;
@Inject
...
...
@@ -310,6 +313,7 @@ public class IndexerServiceImpl implements IndexerService {
String
authority
=
kindParts
[
0
];
String
source
=
kindParts
[
1
];
String
type
=
kindParts
[
2
];
String
[]
versionParts
=
kindParts
[
3
].
split
(
"\\."
);
document
.
setKind
(
storageRecord
.
getKind
());
document
.
setNamespace
(
authority
+
":"
+
source
);
document
.
setAuthority
(
authority
);
...
...
@@ -319,9 +323,12 @@ public class IndexerServiceImpl implements IndexerService {
document
.
setVersion
(
storageRecord
.
getVersion
());
document
.
setAcl
(
storageRecord
.
getAcl
());
document
.
setLegal
(
storageRecord
.
getLegal
());
if
(
storageRecord
.
getTags
()
!=
null
)
{
document
.
setTags
(
storageRecord
.
getTags
());
if
(
storageRecord
.
getTags
()
==
null
)
{
Map
<
String
,
String
>
constantTags
=
new
HashMap
<>();
constantTags
.
put
(
IndexerServiceImpl
.
NORMALIZATION_KIND_TAG_ATTRIBUTE_NAME
,
String
.
format
(
"%s:%s:%s:%s"
,
authority
,
source
,
type
,
versionParts
[
0
]));
storageRecord
.
setTags
(
constantTags
);
}
document
.
setTags
(
storageRecord
.
getTags
());
document
.
setCreateUser
(
storageRecord
.
getCreateUser
());
document
.
setCreateTime
(
storageRecord
.
getCreateTime
());
if
(!
Strings
.
isNullOrEmpty
(
storageRecord
.
getModifyUser
()))
{
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment