Hi Team, Kindly please help me on Graphql. The fol...
# troubleshoot
b
Hi Team, Kindly please help me on Graphql. The following search query return tags that contains
PII
in either name or description. I just wanted to search based on name only.
Copy code
{
  search(
    input: {type: TAG, query: "PII", start: 0, count: 1000}
  ) {
    start
    count
    total
    searchResults {
      entity {
        urn
      }
    }
  }
}
g
Hi @bland-barista-59197 You can orFilter as below
Copy code
search(
    input: {type: TAG, query:"<string to search>", orFilters:{and: {field:"urn", values:["urn:li:tag:<tag-name>"], negated: false}} start: 0, count: 1000}
  ) {
    start
    count
    total
    searchResults {
      entity {
        urn
      }
    }
  }
b
Thank you @gentle-hamburger-31302 But my requirement is get all tags name contain
PII.
Can we query something like
query:"name like '*PII*'"
?
g
@bland-barista-59197 I haven't find such pattern in https://datahubproject.io/docs/api/graphql/getting-started#search @bulky-soccer-26729 Could you please confirm ? Do we need feature request for this ?
b
Ahh i see, great question. I believe that should be answered here in the docs under advanced queries
so for your use case, you can set the
query
to be
/q name: *PII*
b
Thank you @bulky-soccer-26729 I tried but it is not working in Graphql
Copy code
{
  search(
    input: {type: TAG, query: "/q name: *PII*", start: 0, count: 1000}
  ) {
    start
    count
    total
    searchResults {
      entity {
        urn
      }
    }
  }
}