For each search request, you can control which application structure fields are returned by specifying default display fields.
Configure in the console and apply
1. In the console, choose OpenSearch High-performance Search Edition > Feature Extensions—->Search Result Display, then add default display fields.
2. If you do not configure default display fields, you can still specify fields when running a search test in the console by using the following method:
Note: When you set the fetch_fields parameter, separate multiple fields with semicolons.
Configure via the SDK or API
fetch_fields: The size of the returned text data has a significant impact on query performance, so we recommend that you return only the fields you need. If you set this parameter in the SDK or API, it overrides the corresponding feature configuration in the console.
-
API parameter: Set it using the fetch_fields parameter. For more information, see Search processing.
-
SDK configuration: The following example uses the Java SDK:
// Set which fields in the app are returned in the search results
config.setFetchFields(Lists.newArrayList("id","name","phone","int_arr","literal_arr","float_arr","cate_id"));
Note
-
If you do not specify the fetch_fields parameter in the SDK or API, the default display fields configured in the console are returned. If you set the fetch_fields parameter in the SDK or API, the SDK or API configuration takes effect.