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

Autosuggest fields with dot #86

Open
alexpts opened this issue Aug 30, 2023 · 3 comments
Open

Autosuggest fields with dot #86

alexpts opened this issue Aug 30, 2023 · 3 comments

Comments

@alexpts
Copy link

alexpts commented Aug 30, 2023

Input JSON:

  {
    "name": "elasticsearch2",
    "disk.total": "95gb",
    "disk.used": "12.5gb",
    "disk.avail": "82.5gb",
    "ram.max": "2gb",
    "uptime": "5.7h",
    "ip": "172.18.0.2",
    "heap.current": "473.2mb",
    "heap.percent": "46",
    "heap.max": "1gb",
    "ram.percent": "81",
    "node.role": "cdfhilmrstw",
    "master": "*",
    "id": "yVjW",
    "http_address": "172.18.0.2:9200",
    "version": "8.4.1",
    "query_cache.memory_size": "3kb",
    "query_cache.hit_count": "7092",
    "request_cache.hit_count": "1",
    "flush.total": "19",
    "flush.total_time": "39.9s",
    "get.current": "0",
    "port": "9300"
  }
]

On click to input field UI show suggest fields

image

Fields with dot in name don`t work correct.

.name - show name field

  1. Autosuggest must escape name of fields.
  2. How I can escape field with dot manually?
@lahmatiy
Copy link
Member

Yeah, this should be fixed. However, it's a tricky one.

How I can escape field with dot manually?

You could use bracket notation in such cases, e.g. $['disk.avail'] or some.path['disk.avail'].

@alexpts
Copy link
Author

alexpts commented Oct 1, 2023

Thanks!

I cant use it for top level, but it works with map syntax .() for me:

.({'disk.avail': $['disk.avail'] })

@lahmatiy
Copy link
Member

lahmatiy commented Oct 3, 2023

Yes, it doesn't work as a mapping for arrays, but as a read property of a value operation disregarding of value's type. For arrays you need to use .() (or .map()) as you do.

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