Understanding URL Query Parameters for Flexible Searching in Advanced Filters

Original Slack Thread

Hi team, I find that even in advanced filter there are some rules are not support, such as column name = "id" , while it can be reached if I modify the url directly. I want to know if there is a guidance that introduce the rules used for url, if so, I can concatenate url by my own and do searching more flexibly

<@U03BEML16LB> Would love your help here!

hey patrick! i’m not sure what you mean for column name = “id” since I believe we do indeed support that with advanced search

in general, how we keep track of different filters in the URL looks like this as a query param:
?filter_fieldPaths___false___CONTAIN___0=id
where we prefix with filter_ and then comes the field that we’re filtering on (fieldPaths in this case which is the elastic search name for column name) then it’s whether or not this condition is negated (whether it’s NOT this condition or IS this condition - in this case that’s false). Then we have the filter opterator (this case it’s CONTAIN). Finally the last piece is just the index of the filter in the URL

<@U03BEML16LB> The version I use is v0.9.6.1. And yes, the advanced search supports ?filter_fieldPaths___false___CONTAIN___0=id like what shown in the below screenshot 1. While the column it matched is instance_id and what I want is only id.
To get what I want, I don’t find there is a choose to set column name = "id" in the UI but I can modify the url directly and use ?filter_fieldPaths___false___EQUAL___0=id and it works.

attachment

ooo now I see what you’re saying - yeah that is just a limitation with our current filter UI but definitely something to be approved upon. thanks for this info!

<@U03BEML16LB> thanks for letting me know. One more asking is that if there’s a doc about the rules of urls for me to refer to. Just as shown above, I want to concatenate url by my own which can cover all of the search request.

I don’t believe there’s any specific docs around this, it would just be in our frontend code for when we redirect users after making search requests

<@U03BEML16LB> could you show me the path to access the specific frontend code?

yeah! so we call this function navigateToSearchUrl from several different places in the frontend when we need to search with some filters/query. it’s located here /datahub/datahub-web-react/src/app/search/utils/navigateToSearchUrl.ts

if you do make changes that will obviously require you to fork the repo and maintain those changes whenever you upgrade

<@U03BEML16LB> This is incredibly helpful for me! After reviewing the code, I have a few questions.

  1. how to use 'SEARCH__' and 'EXACT__' ? When I search something I find it just uses 'filter_' like search?filter_platform___false___EQUAL___0=urn%3Ali%3AdataPlatform%3Ahive
  2. what’s the difference between 'fieldDescriptions' and 'editedFieldDescriptions' , 'fieldTags' and 'editedFieldTags'
  3. how to show data whose fieldtag contains tagA or tagB, I tested filter_fieldTags___false___CONTAIN___0=tagA,tagB and filter_fieldTags___false___CONTAIN___0=urn:li:tag:tagA,urn:li:tag:tagB but both of them didn’t work
  4. how to show data whose fieldtag contains tagA and tagB, I tested filter_fieldTags___false___EQUAL___0=tagA,tagB and filter_fieldTags___false___EQUAL___0=urn:li:tag:tagA,urn:li:tag:tagBbut both of them didn’t work
  5. how to show data whose schema is schemaA, I attempted it but it seems the URN of schema is unrelated with the schema name
  6. how to show tables named DB.table1 if it exists in different sources and I want all of them
  7. how to show tables like DB.table1, I find that if I search a table in search bar, it will show all the data related to the table name, including the tables whose name are similar with that table

Hi <@U03BEML16LB> please have a look when you are available