Skip to content
Snippets Groups Projects

Implement search in namespace context

Merged Pavel Barzou requested to merge #89-inplement-search-in-namespace-context into master

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

Link to task

Link to ADR

Before merging this MR we should merge MRs with constants before, according to comment !653 (comment 316947)

Edited by Pavel Barzou

Merge request reports

Merge request pipeline #273608 failed

Pipeline: Search

#273611

    Merge request pipeline failed for 14bfd347

    6 environments impacted.
    Approved by

    All merge request dependencies have been merged (2 merged)

    Merged by Rostislav Dublin (EPAM)Rostislav Dublin (EPAM) 9 months ago (Jul 16, 2024 1:39pm UTC)

    Merge details

    Pipeline #274035 failed

    Pipeline failed for d3f30494 on master

    9 environments impacted.

    Activity

    Filter activity
    • Approvals
    • Assignees & reviewers
    • Comments (from bots)
    • Comments (from users)
    • Commits & branches
    • Edits
    • Labels
    • Lock status
    • Mentions
    • Merge request status
    • Tracking
  • Pavel Barzou added 1 commit

    added 1 commit

    Compare with previous version

  • resolved all threads

  • Rucha Deshpande
  • Pavel Barzou changed the description

    changed the description

  • Pavel Barzou resolved all threads

    resolved all threads

  • @Pavel_Barzou , can you please rebase and resolve conflicts.

  • Pavel Barzou added 5 commits

    added 5 commits

    Compare with previous version

  • Pavel Barzou resolved all threads

    resolved all threads

  • Solomon Ayalew approved this merge request

    approved this merge request

  • Thulasi Dass Subramanian approved this merge request

    approved this merge request

  • Pavel Barzou added 1 commit

    added 1 commit

    Compare with previous version

  • Pavel Barzou reset approvals from @thulasi_dass and @solxget by pushing to the branch

    reset approvals from @thulasi_dass and @solxget by pushing to the branch

  • Pavel Barzou added 1 commit

    added 1 commit

    • b32ea5c1 - Added support for a new version of the core-common

    Compare with previous version

  • Pavel Barzou added 1 commit

    added 1 commit

    Compare with previous version

  • mentioned in merge request !664 (closed)

  • Thulasi Dass Subramanian approved this merge request

    approved this merge request

  • Solomon Ayalew approved this merge request

    approved this merge request

  • Pavel Barzou changed the description

    changed the description

  • Pavel Barzou added 10 commits

    added 10 commits

    Compare with previous version

  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Please register or sign in to reply
    Loading