I have json docs that contain one field "content" (and ID) with many nested json key:value objects. In addition, there can be many of the same keys int the document.
I can index and search the documents. However, I want to display the URL, Title, etc., as the query response. I see how to do this if they are fields in a simpler structure, but unclear how to display these based on the example. Currently, I get the "content" with the key:value pair based on the search term.
i.e.
"content": {"title":"doc title"}
"id": "doc-12233444"
or
"content": {"url":"https://www.xxx.com"}
"id": "doc-12233444"
This is how the field in the above example is used in Kibana:
{"field": "content.title.keyword"}
I'm a nube at Elastic App Search. Any help would be greatly appreciated.
Hey @cerro. Your best bet, if possible, is to index your documents as a flat structure. App Search unfortunately doesn't have first class support for nested fields like that.
That being said, if you index the content from your example, you'll get an API response that contains the following:
The "snippet" value, which can be used for highlighting, will only contain a single value based on the search term, as you mentioned. However, the "raw" field can be used to display all values from content.
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.