Projections

Default projections

By default, search API only returns id and version fields of first 50 matched documents. per_page parameter can be used to limit the number of results returned.


Explicit projections

If you wish to fetch other fields as well, you need to explicitly request them using projections. Projections are requested by providing array of attribute names. If listed attributes exist, they will be returned for each item in response (otherwise error will be returned).


Custom Fields projections

Custom fields in projections behaves exactly as describe in the section above. If the requested custom fields exist, they will be returned for each item in response, otherwise they will be ignored. Before you proceed you need a list of unique identifiers of the custom fields that you’re going to request. Notice that you can’t simply get all the custom fields by querying "custom_fields" attribute - the query will result with an error. All the currently exposed indices support custom fields.

See the table below for the syntax:

Syntax Index Example Notes
custom_fields.{customFieldId} leads custom_fields.1
custom_fields.{customFieldId} deals custom_fields.1
custom_fields.contact:{customFieldId} contacts custom_fields.contact:1 Where customFieldId is a unique identifier of a contact’s custom field
custom_fields.sales_account:{customFieldId} contacts custom_fields.sales_account:1 Where customFieldId is a unique identifier of a sales account’s custom field