Skip to content

Request to add token for keyword field type #5240

Closed

Description

@andreadelrio

Hi team, we're in need of a token for the keyword field type to be used in Discover (and Data Visualizer). Our aim is to use two different tokens for the text type and the keyword type (currently we use tokenString for both which could lead to confusion).

There already exists a token called tokenKeyword but as far as I can tell it is meant for a different definition of keyword.
Now what is the keyword type? I find this definition useful:

The primary difference between the text datatype and the keyword datatype is that text fields are analyzed at the time of indexing, and keyword fields are not. What that means is, text fields are broken down into their individual terms at indexing to allow for partial matching, while keyword fields are indexed as is. For example, a text field containing the value “Roosters crow everyday” would get all of its individual components indexed: “Roosters”, “crow”, and “everyday”; a query on any of those terms would return this string. However, if the same string was stored as a keyword type, it would not get broken down. Only a search for the exact string “Roosters crow everyday” would return it as a result.

I'm hoping to collect some ideas here for what that new token could look like so that we can look into creating it. Some ideas that we've had are a) a "k" letter and b) using quotes.

Activity

  1. andreadelrio commented on Oct 5, 2021

    @andreadelrio
    ContributorAuthor

    @timroes @qn895 please let me know what you think about these two alternatives and if you have any other ideas you'd like me to explore

    Frame 21

    Frame 20

  2. timroes commented on Oct 6, 2021

    @timroes
    Contributor

    While I am always in favor of a much saying icon, I have the feeling we might simply not find an icon that is self-explanatory by itself, so I am currently actually tending more towards simply using the letter k for the keyword fields and keep t for text fields. cc @kertal @majagrubic any thoughts from you?

  3. elizabetdev commented on Oct 6, 2021

    @elizabetdev
    Contributor

    @andreadelrio I also think the letter k works better. 👍🏽

  4. kertal commented on Oct 6, 2021

    @kertal
    Member

    ok!

  5. andreadelrio commented on Oct 6, 2021

    @andreadelrio
    ContributorAuthor

    Thank you all for your input. I've opened a PR adding this icon here #5251.

    @timroes @kertal Does using the same color pattern as the token for text sound good? We have a number of color combinations we can use if we prefer that. One reason to keep text and keyword aligned would be to have text-based fields in the same colors. However, if we want to make the difference easier to spot we could pick another color set for this new icon. You can check color options here.

  6. timroes commented on Oct 7, 2021

    @timroes
    Contributor

    I all in favor of keeping the same color!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions