Skip to content
Fluxer API

Search indexes

You can rebuild a search index from current data and check how far the rebuild has got. Each rebuild shows up in Jobs as refreshSearchIndex.

A rebuild clears the index first, and search over that index returns partial results until the rebuild finishes. discovery and threads do not clear anything.

ValueScopeDescription
guildsInstanceEvery guild
usersInstanceEvery account
reportsInstanceEvery report
audit_logsInstanceEvery Admin audit log entry
discoveryInstanceDiscovery details of approved listings in the guilds index
channel_messages1GuildMessages in every channel and thread of one guild
guild_membersGuildMembers of one guild
threads2GuildThreads used by Search threads
all3InstanceEvery index above, for every guild, and messages in every channel, thread and DM

1 Progress shows completed once every channel is queued for indexing, and total and indexed count channels. Messages keep indexing after that.

2 Search threads returns 202 for the guild until the rebuild completes.

3 Rebuilds one index at a time and clears each one first, including threads. Only one all rebuild runs at a time.

FieldTypeDescription
successbooleanAlways true
job_idstringThe ID of the rebuild, used to get its progress
{
"success": true,
"job_id": "1501314428688998182"
}

An unknown or expired job_id returns the not found structure, and every other rebuild returns the progress structure.

FieldTypeDescription
statusstringAlways not_found
FieldTypeDescription
statusstringOne of in_progress, completed, or failed
index_typestringThe search index name being rebuilt
phase?stringFor all, the index it is on, messages, or queued before it starts
total?1numberThe progress total
indexed?1numberThe number of documents written so far
started_at?ISO8601 timestampThe time the rebuild last reported progress
completed_at?ISO8601 timestampThe time the rebuild finished, when status is completed
failed_at?ISO8601 timestampThe time the rebuild failed, when status is failed
error?stringThe failure text, when status is failed

1 In the guild_members, threads and messages phases of all, both count guilds or channels. For discovery, total is the number of approved listings. Otherwise total equals indexed until status is completed.

POST/v1/admin/search/indexes/{index_name}/refreshesAudit reason

Queues a rebuild of the index and returns its job_id. You need the guild:lookup ACL. A failed rebuild is not retried, so queue a new one. While an all rebuild runs, queueing all again returns its job_id.

FieldTypeDescription
index_namestringOne of the search index names
FieldTypeDescription
guild_id?snowflakeThe ID of the guild to rebuild, needed by channel_messages, guild_members and threads
StatusBodyCondition
200search index refresh objectThe rebuild was queued or is already running
400error responseINVALID_FORM_BODY when the index needs guild_id and it is missing
403error responseFEATURE_TEMPORARILY_DISABLED when index_name is all on an instance with no search backend

Fluxer records an Admin audit log entry with the action queue_refresh_index and the target type search_index.

The rate limit is 200 requests per minute, on the admin:lookup bucket.

GET/v1/admin/search/index-refreshes/{job_id}

Returns the progress of a rebuild. You need guild:lookup. Progress expires one hour after the last update.

FieldTypeDescription
job_idstringThe job_id returned by Refresh search index
StatusBodyCondition
200search index refresh progress objectThe progress or the not_found structure was returned

The rate limit is 200 requests per minute, on the admin:lookup bucket.