Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Question] What's the mapping between a custom search attribute and corresponding filter in basic search mode? #282

Closed
ssurve opened this issue Apr 16, 2021 · 5 comments

Comments

@ssurve
Copy link

ssurve commented Apr 16, 2021

We've registered a custom search attribute of type "KEYWORD" in our backend (Cadence server with Elastic Search). Let's call it CustomWorkflowName.

Using the Advanced search mode in the cadence-web UI, I can do searches like:
CustomWorkflowName="nyse_stocks" and get results back.

I intend to add a search input in the Basic search mode to search against this attribute. What changes will I need to make?

I've tried adding a new "customWorkflowNameFilter" (object with key customWorkflowName and value q.customWorkflowName) in routes.js and also made the relevant updates in the shared.thrift idl file but haven't been able to make this work.


Looking at the input element for "Workflow Name" -- it seems like this is the underlying mapping:
q.workflowName -> name (key in typeFilter) -> WorkflowTypeFilter (struct in shared.thrift)

WorkflowType attribute is not referenced anywhere and yet we get results for that attribute as expected since there seems to be a mapping between WorkflowType and WorkflowTypeFilter. Where is this mapping defined?

@ssurve
Copy link
Author

ssurve commented Apr 19, 2021

Tagging @just-at-uber, @nathanboktae for visibility.

@just-at-uber
Copy link
Contributor

just-at-uber commented Apr 19, 2021

It's because the underlying API which the basic search relies on does not use search attributes. You would need to update the API in /server to use the list API and make the corresponding changes there. These APIs are not 1-to-1 so you would need to craft the relevant params into a query string to make this working.

@just-at-uber
Copy link
Contributor

Alternatively you could make the change in cadence-server to accept search attributes.

@just-at-uber
Copy link
Contributor

We will be looking at making the basic filter use the list API in upcoming work as an option if ES is available.

@just-at-uber
Copy link
Contributor

basic search will now use list api if elastic search (or advanced search) is supported as part of v3.27.0 release. Otherwise will fallback to open / closed APIs. Closing as this should now work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants