Skip to main content

Index

info

Index schemas are currently in preview. Contact us if you would like to try it out.

The index object is where you define the structure of the index. The index defines what kind of data you can add to the index in the properties method.

Index example
index: {
fields: {
sku: { type: "keyword" },
title: { type: "text" },
description: { type: "text" },
isActive: { type: "boolean" }
}
}

The index object must have a fields property with the fields you want to include in the index.

Each field object must include type. The type specifies the data type for the index field.

Types

Setting the right types for the properties in your index is important. The types defines the intend of the fields and prevents data of other types from going into the index. The types also helps with effeciently index, search, and analyze of the data added to the index.

Text

TypeDescription
keywordThe Keyword type is for string values used in filtering and sorting
textThe text type will analyze string values, improving results when querying using full text search

Numeric

TypeDescription
integerA 32 bit signed integer
longA 64 bit signed integer
floatA 32 bit signed floating number
doubleA 64 bit signed floating number

Boolean

TypeDescription
booleanA true / false value

Date

TypeDescription
dateSupport values like a Javascript Date object, a string like 2024-11-21T23:00:00Z or number of milliseconds since eclipse

List

TypeDescription
keyword[]List of the Keyword type for string values used in filtering and sorting
text[]List of the text type for analyzing string values, improving results when querying using full text search
integer[]List of 32 bit signed integers
long[]List of 64 bit signed integers
float[]List of 32 bit signed floating numbers
double[]List of 64 bit signed floating numbers
boolean[]List of true / false values
date[]List of dates with supported values like a Javascript Date object, strings like 2024-11-21T23:00:00Z or numbers of milliseconds since eclipse

Range

TypeDescription
integerRangeMust be an object like
{"gt": 10, "lt": 20} or
{"gte": 10, "lte": 20}
longRangeMust be an object like
{"gt": 10, "lt": 20 } or
{"gte": 10, "lte": 20}
floatRangeMust be an object like
{"gt": 10.0, "lt": 20.0} or
{"gte": 10.0, "lte": 20.0}
doubleRangeMust be an object like
{"gt": 10.0, "lt": 20.0} or
{"gte": 10.0, "lte": 20.0}
dateRangeMust be an object like
{"gt": "2025-01-01", "lt": "2025-02-01"} or
{"gte": "2025-01-01", "lte": "2025-02-01"}