Search Attributes Don't Match in Search

Hi Folks,

I have text field Search Attributes enabled in my workflows. I passed a string about 195 characters long. However, when I search for the workflow in the Temporal UI and ListViolations endpoint I will pull workflows that don’t have the same string Search Attribute.

For reference, the first ~20 or so characters matchup, but the rest does not.

Was wondering if there’s a limitation to the size of the text field, and if there’s any remedy for it.

Thanks!

Found the issue, we should use Keyword type rather than Text type. Leaving the post up for posterity!

Thanks for resolving! Just posting a reference to the Temporal Docs regarding differences between Keyword and Text types: https://docs.temporal.io/search-attribute. Keywords support exact matches, Text supports substring matches.

  • Keyword and Text types are concepts taken from Elasticsearch. Each word in a Text is considered a searchable keyword. For a UUID, that can be problematic because Elasticsearch indexes each portion of the UUID separately. To have the whole string considered as a searchable keyword, use the Keyword type. For example, if the key ProductId has the value of 2dd29ab7-2dd8-4668-83e0-89cae261cfb1:

    • As a Keyword it would be matched only by ProductId = "2dd29ab7-2dd8-4668-83e0-89cae261cfb1.

    • As a Text it would be matched by ProductId = 2dd8, which could cause unwanted matches.