All Products
Search
Document Center

OpenSearch:Formats of query results

Last Updated:Feb 28, 2024

Supported formats

OpenSearch Retrieval Engine Edition can return query results in XML format and JSON format. Query results in XML format are highly readable. The system requires long periods of time to format query results in XML format. You can use this format when you troubleshoot issues. Query results in JSON format are also highly readable. The system requires a shorter period of time to format a query result in JSON format. By default, the SDKs of OpenSearch Retrieval Engine Edition use the JSON format. Query results in Protobuf format are unreadable. Data in ProtoBuf format requires low bandwidth and can be deserialized in an efficient manner. You can use this format when high performance is required.

Specify a format

You can include the format parameter in the config clause to specify the XML format or JSON format as the result format. By default, query results are returned in XML format. For example, the following config clause specifies that the query result is returned in JSON format:

config=cluster:cluster1,format:json&&query=phrase:"Mobile"