| « PreviousNext » | |
![]() ![]() ![]() | Did this page help you? Yes | No | Tell us about it... |
By default, searches only return the IDs of the documents that match the search constraints. To include additional information, you can use the return-fields parameter to specify which index fields to include in the results.
Integer fields (uint) can always be returned in results. However, only text and literal fields that are result enabled in the domain configuration can be returned. You can also specify the default text_relevance score as a return field.
You can retrieve up to 2 KB of source data from an index field. All of the source data is indexed, but only the first 2 KB of data can be returned.
Note
Making fields result enabled increases the size of your index, which can increase the cost of running your domain. You should only store document data in the search index by making fields result-enabled when it's difficult or costly to retrieve the data using other means. Since it can take some time to apply document updates across the domain, critical data such as pricing information should be retrieved using the returned document IDs instead of returned from the index.
To retrieve source data for result-enabled fields, you specify the return-fields parameter in the query string. You can specify a single return field, or up to 10 fields as a comma-separated list. For example, to include the actor, title, and default text_relevance score in the search results:
search?q=star+wars&return-fields=actor,title,text_relevance
The specified fields will be included for each hit:
{
"id":"tt1185834",
"data":{
"actor":["Abercrombie, Ian","Baker, Dee Bradley","Burton, Corey",
"Eckstein, Ashley","Futterman, Nika","Kane, Tom",
"Lanter, Matt","Taber, Catherine","Taylor, James Arnold",
"Wood, Matthew"],
"text_relevance":["308"],
"title":["Star Wars: The Clone Wars"]
}
}