[英]How to access fields with special characters from _source?
I am creating a search application in React using searchkit. 我正在使用searchkit在React中创建一个搜索应用程序。 Some of the fields in my _source have special characters in the beginning, like _index or @timestamp.
我的_source中的某些字段开头都有特殊字符,例如_index或@timestamp。 I am not able to access those fields using source._index, the way I can access fields without special characters, like source.Body.
我无法使用source._index访问这些字段,也无法访问没有特殊字符(例如source.Body)的字段。
My sourceFilter looks like this: 我的sourceFilter看起来像这样:
sourceFilter={["@timestamp", "From", "MessageStatus", "SmsStatus", "To", "Message", "Timestamp", "Body", "_index"]}
I am trying to access the fields to set the html using dangerouslySetInnerHtml. 我正在尝试使用危险地设置InnerHtml访问字段来设置html。
How can I either change what the field is called or access a field with a special character? 如何更改字段的名称或访问具有特殊字符的字段?
最后,我在elasticsearch索引中创建了一个新字段,其名称没有特殊字符。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.