temporal icon indicating copy to clipboard operation
temporal copied to clipboard

Support wildcard search for workflows

Open longquanzheng opened this issue 3 years ago • 2 comments

To mirror issue in Cadence: https://github.com/uber/cadence/issues/3962

longquanzheng avatar Jul 05 '22 17:07 longquanzheng

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 WorkflowId that is <productId>-<uuid>, looking it up by productId).
  • 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:

image

Alternative

Use custom Search Attributes. (This works fine, but it would be nicer from DX perspective if users didn't have to do this.)

lorensr avatar Jul 20 '22 18:07 lorensr

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'

lorensr avatar Aug 04 '22 19:08 lorensr