temporal
temporal copied to clipboard
Support wildcard search for workflows
To mirror issue in Cadence: https://github.com/uber/cadence/issues/3962
I propose:
- Keep built-in Keyword search attributes as Keywords
- Allow wildcards and/or regexes in List Filters
Background info
Summarizing comments from internal Slack:
- Wildcard search for built-in Keyword search attributes is a recurring request/need (like with a
WorkflowIdthat is<productId>-<uuid>, looking it up byproductId). - Text type is more work for ES than Keyword —Liang
- Keyword supports these term-level queries: regexp and wildcard:
- https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-wildcard-query.html
- https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-regexp-query.html
Use a keyword family field type if:
- The content is machine-generated, such as a log message or HTTP request information.
- You plan to search the field for exact full values, such as org.foo.bar, or partial character sequences, such as org.foo.*, using term-level queries.
Note that the regexp and wildcard require allow_expensive_queries: true:

Alternative
Use custom Search Attributes. (This works fine, but it would be nicer from DX perspective if users didn't have to do this.)
Another alternative:
I don't know how performant this is, but @mjameswh shared that BETWEEN works on Keywords, so for example:
WorkflowId BETWEEN "myprojid1-" AND "myprojid1-zzzzzzzzzzz"
would match 'myprojid1-randomalpha'