Implement search in namespace context
Implemented search in custom namespaces with x-collaboration header. The code is feature flagged with collaborations-enabled flag
curl --location 'localhost:8092/api/search/v2/query' \
--header 'Content-Type: application/json' \
--header 'data-partition-id: osdu' \
--header 'x-collaboration: id=96d5550e-2b5e-4b84-825c-646339ee5fc7,application=pws' \
--header 'Authorization: ••••••' \
--data '{
"kind":"osdu:search1717500302132:test-data--Integration:1.0.6"
}
When we send request with x-collaboration will be add part to request to ElasticSearch:
"bool": {
"must": [{
"bool": {
"must": [{
"bool": {
"must": [{
"exists": {
"field": "x-collaboration"
}
},{
"term": {
"x-collaboration": "id=96d5550e-2b5e-4b84-825c-646339ee5fc7,application=pws"
}
}]
}
}]
}
}]
}
If we will send request without x-collaboration header:
curl --location 'localhost:8092/api/search/v2/query' \
--header 'Content-Type: application/json' \
--header 'data-partition-id: osdu' \
--header 'Authorization: ••••••' \
--data '{
"kind": "osdu:wks:master-data--CollaborationProject:1.0.0",
"query": "id:\"osdu:master-data--CollaborationProject:275f1abfc7c44f35b5173e7c987638e8\""
}
To request will be added:
"bool": {
"must_not": {
"exists": {
"field": "x-collaboration"
}
}
}
Type of change
-
Bug Fix -
Feature
Please provide link to gitlab issue or ADR(Architecture Decision Record)
Does this introduce a change in the core logic?
- [YES]
Does this introduce a change in the cloud provider implementation, if so which cloud?
-
AWS -
Azure -
Google Cloud -
IBM
Does this introduce a breaking change?
- [NO]
What is the current behavior?
We can't searching in different custom namespaces
What is the new/expected behavior?
We can searching in different custom namespaces
Have you added/updated Unit Tests and Integration Tests?
Added Unit and Integration tests
Any other useful information
Before merging this MR we should merge MRs with constants before, according to comment !653 (comment 316947)
Merge request reports
Activity
assigned to @Pavel_Barzou
added 2 commits
added AWS label
requested review from @Rostislav_Dublin
- Resolved by Rustam Lotsmanenko (EPAM)
added Common Code label
changed milestone to %M24 - Release 0.27
added P&WS label
added MRNew Feature label
- Resolved by Pavel Barzou
- Resolved by Pavel Barzou
the description query have nested
"query": { "bool": {
why is that for? one bool should be enough.
Edited by Solomon Ayalew
@Pavel_Barzou , can you please rebase and resolve conflicts.
added 5 commits
-
835fc19a...8d1c2ebd - 4 commits from branch
master
- 142bc3dd - Merge branch 'master' into #89 (closed)-inplement-search-in-namespace-context
-
835fc19a...8d1c2ebd - 4 commits from branch
reset approvals from @thulasi_dass and @solxget by pushing to the branch
added 1 commit
- b32ea5c1 - Added support for a new version of the core-common
mentioned in merge request !664 (closed)
mentioned in merge request osdu/platform/deployment-and-operations/terraform-deployment-aws!48 (closed)
- Resolved by Pavel Barzou
- Resolved by Pavel Barzou
- Resolved by Pavel Barzou
- Resolved by Pavel Barzou
- Resolved by Pavel Barzou
Can you please rebase your MR, it's behind 8 commits?
- Resolved by Pavel Barzou
- Resolved by Pavel Barzou
I see all
collaboration-enabled
is set to false for all providers, then how are we validating this change via integration tests? Are they even running?
- Resolved by Pavel Barzou
mentioned in merge request osdu/platform/system/lib/core/os-core-common-spring6!7 (merged)
mentioned in merge request osdu/platform/system/lib/core/os-core-common!273 (merged)
added 10 commits
-
c444a202...a72a9538 - 8 commits from branch
master
- 1c8e15ae - Improve request to elastic, integration tests
- c392f26d - Merge branch 'master' into #89 (closed)-inplement-search-in-namespace-context
-
c444a202...a72a9538 - 8 commits from branch