Skip to main content
Algolia uses JSON to model records. Your records can have attributes with the following types: For example, this record includes different data types and the _tags reserved attribute:
JSON
Although integer and boolean values are treated as strings by searchable attributes, they’re interpreted as numbers for numerical facets. For example, Algolia treats like_count as a number.

Unique record identifiers

The objectID attribute is a unique identifier for each record. Set object IDs yourself, based on your data. If you don’t set object IDs, Algolia assigns them automatically: you can check their values by browsing the . When you retrieve records, object IDs are in string format, even if you set them as integers. If you want to use integers in your app, convert object IDs to integers after retrieving the records but make sure that all your object IDs contain integer values. Since objectID uniquely identifies your objects, the following applies:

Keep object IDs stable

Derive each objectID from the unique identifier of the record’s source, such as a database primary key or a product SKU. Don’t derive it from the record’s content, for example by hashing the attributes you send. An object ID must identify the same item for as long as that item exists:
  • Updates and deletions target an object ID. If the ID changes when the content changes, an update creates a second record instead of replacing the first, and the original stays in the index until you delete it.
  • Click and conversion events reference an object ID. If the ID changes, the record’s event history splits across two IDs, and features that build on that history, such as Dynamic Re-Ranking, Recommend, and Personalization, lose the earlier signals.
When one source item becomes several Algolia records, for example when you split a long document into sections or flatten a product’s variants, build each object ID from the source identifier plus a deterministic suffix:
JSON
Use a suffix that stays the same across reindexing, such as a variant identifier or a section anchor. Don’t use a value that shifts when the source changes, such as an array position or an incrementing counter.

Acceptable characters for object IDs

objectID strings can:
  • Contain any character.
  • Be of any length as long as the record fits within your plan’s size limit.

Dates

Date attributes must be formatted as Unix timestamps (for example, 1435735848). To convert dates to Unix timestamps, use an appropriate function for your programming language, for example:
Depending on the language, the output might require conversion from milliseconds to seconds.

Reserved attribute names

The following attribute names are reserved by Algolia.
  • _geoloc
  • _highlightResult
  • _rankingInfo
  • _snippetResult
  • _tags
  • distinctSeqId
The _collections attribute is reserved only if you’re using InstantSearch to implement a collections page. If you’re not using InstantSearch, _collections behaves like any other attribute.

In your records

In a record, you can use the _tags or _geoloc attribute names but they have an imposed schema. Other attribute names are schema-agnostic. Algolia doesn’t search reserved attribute names unless you explicitly include them in searchableAttributes.

In the search response

Algolia returns _highlightResult, _snippetResult, _rankingInfo, and _distinctSeqID in the search response. They’re reserved Algolia attributes tied to specific features. To avoid conflicts, don’t specify these attribute names in your records.
Last modified on August 31, 2026