This is a preview of PR #723, not valkey.io.

FT.INFO

Usage:
FT.INFO index-name [ LOCAL | PRIMARY | CLUSTER ] [ ALLSHARDS | SOMESHARDS ] [ CONSISTENT | INCONSISTENT ]
Complexity:
O(1)
Module:
valkey-search
Since module version:
1.0.0
ACL Categories:
@read, @fast, @search

The FT.INFO command provides information about an index. Variants of the command are available in cluster mode to aggregate index information across the cluster.

FT.INFO <index-name>
  [LOCAL | PRIMARY | CLUSTER]
  [ALLSHARDS | SOMESHARDS]
  [CONSISTENT | INCONSISTENT]
  • <index-name> (required): The name of the index to return information about.

  • LOCAL (optional): Only the executing (local) node provides index information. This is the default.

  • PRIMARY (optional): The primary nodes of every shard in the cluster are queried to generate index information. This is only valid when cluster mode is enabled.

  • CLUSTER (optional): All nodes, primary or replica, are queried to generate index information. This is only valid when cluster mode is enabled.

  • ALLSHARDS (optional): If specified, a response is required from every shard in the system. If all responses are not received within a time window the command is terminated with an error. This is the default.

  • SOMESHARDS (optional): If specified, a response is NOT required from every shard in the system. If all responses are not received within the time window, only the received responses are returned and no error is generated.

  • CONSISTENT (optional): If specified, the command is terminated with an error if any received response isn't from a consistent version of the index. This is the default.

  • INCONSISTENT (optional): If specified, a command result is generated using only the responses from nodes with a consistent version of the index.

Reply#

Response when LOCAL is specified#

The LOCAL response contains both the definition of the index as well as the status of that index on the node that executes the command.

An array of key value pairs.

  • index_name (string) The index name

  • index_definition (an array of key/value pairs)

    • key_type (string) HASH or JSON
    • prefixes (array of strings) The declared prefixes for this index
    • filter (string) The index's FILTER expression. Only present when the index was created with FILTER.
    • default_score (double) The index's configured SCORE value
    • score_field (string) The index's configured SCORE_FIELD, or an empty string if none

    The two fields above require search.emulate-release to be 1.3.0 or later. Below that — including at the default setting — index_definition omits score_field and reports default_score as the bulk string "1". See COMPATIBILITY.md.

    The other fields that 1.3.0 adds to this reply, filter_rejected_keys and the per-attribute SORTABLE and UNF pairs, are reported regardless of search.emulate-release.

  • attributes (array of arrays) One entry per declared attribute of the index.

    • identifier (string) identifier for this attribute
    • attribute (string) The name used to refer to this index in query and aggregation expressions.
    • user_indexed_memory (integer) Number of bytes of user data ingested into this field.
    • type (string) One of NUMERIC, TAG, TEXT or VECTOR
    • Type-specific extension (see below)
    • SORTABLE (string) 1 if the attribute was declared SORTABLE, 0 otherwise. Not reported for VECTOR attributes; SORTABLE on a vector is accepted but has no effect and is not reported.
    • UNF (string) 1 if the attribute was declared SORTABLE UNF, 0 otherwise. Reported only for TAG and TEXT attributes, the only types whose sort value is normalized.

    Unlike RediSearch, which emits SORTABLE and UNF as bare tokens only when set, Valkey Search always emits them as key/value pairs.

  • num_docs (integer) Total keys in the index

  • num_records (integer) Total number of fields indexed.

  • total_term_occurrences (integer) Total number of terms in all text fields in this index.

  • num_terms (integer) Total number of unique terms in all text fields in this index.

  • hash_indexing_failures (string) INTEGER. Number of field values that produced nothing to index when a key was first added: malformed values (for example a non-numeric NUMERIC value, a wrong-size VECTOR, or invalid UTF-8) and values that yield no tags.

  • filter_rejected_keys (string) INTEGER. Number of filter-rejection events: each time a key is evaluated against the index FILTER expression and does not satisfy it, the count increases by one. A key can be rejected more than once (for example, when it is rewritten, or when it is written while the initial backfill is in progress), so this is not a count of distinct keys. For a HASH index a FILTER may reference a field that is not declared in the schema, so a misspelled field name behaves as a missing field rather than failing the command. A large value can mean that a field name in the FILTER is misspelled.

  • backfill_in_progress (string). "1" if a backfill is currently running. "0" if not.

  • backfill_complete_percent (string) Estimated progress of background indexing. Percentage is expressed as a fractional value from 0 to 1.0.

  • mutation_queue_size (string) Number of keys contained in the mutation queue.

  • recent_mutations_queue_delay (string) 0 sec if the mutation queue is empty. Otherwise it is the elapsed time, from scheduling through completion of processing, recorded by the last sampled mutation to update this statistic, in whole seconds rounded down, in the form <seconds> sec. One in every 1000 scheduled mutations is sampled; mutations processed inline are not sampled.

  • state (string) Current backfill state. ready indicates that no backfill is in progress. backfill_in_progress backfill operation proceeding normally. backfill_paused_by_oom backfill is paused because the Valkey instance is out of memory.

The following four fields are only present when the index has at least one TEXT attribute.

  • punctuation (string) list of punctuation characters.
  • stop_words (array of strings) list of stop words. Empty if the index was created with NOSTOPWORDS.
  • with_offsets (string) "1" if offsets are included. "0" if offsets are not included
  • min_stem_size (integer) Minimum stemming size for this index.

The following field is always present:

  • language (string) The index's LANGUAGE, reported in lowercase (for example, english). english if the index was created without LANGUAGE.

NUMERIC Field Type Extension#

  • size (string) INTEGER. Number of keys that have this numeric attribute present.

TAG Field Type Extension#

  • SEPARATOR (string) The actual separator character.
  • CASESENSITIVE (string) "0" or "1".
  • size (string) INTEGER. Number of keys that have this tag attribute present.

TEXT Field Type Extension#

  • WITH_SUFFIX_TRIE (string) "0" or "1".
  • NO_STEM (string) "0" or "1".
  • WEIGHT (string) The attribute's WEIGHT. Currently always "1".

VECTOR Field Type Extension#

  • index (array)
    • capacity (integer) The current capacity for the total number of vectors that the index can store.
    • dimensions (integer) Dimension count
    • distance_metric (string) Possible values are L2, IP or COSINE
    • size (string) INTEGER. Number of valid vectors for this attribute
    • data_type (string) Element data type of the vector. Possible values are FLOAT32, FLOAT16 or BFLOAT16
    • algorithm (array of key/value pairs) Extended information about the vector indexing algorithm for this attribute.

FLAT VECTOR Field Type Extension.

  • name (string) FLAT.
  • block_size (number) block size for this attribute.

HNSW VECTOR Field Type Extension.

  • name (string) HNSW.
  • m (integer) The count of maximum permitted outgoing edges for each node in the graph in each layer. The maximum number of outgoing edges is 2*M for layer 0. The default is 16. The maximum is set by search.max-vector-m.
  • ef_construction (integer) Number of candidate vectors examined while building the index. The default is 200, and the maximum is set by search.max-vector-ef-construction. Higher values increase the time needed to create indexes, but improve the recall ratio.
  • ef_runtime (integer) The configured field-level EF_RUNTIME value.

Response when the PRIMARY option is specified.#

An array of key value pairs

Totals are summed over the primaries that responded. With SOMESHARDS, a primary that does not respond is omitted, so totals may be lower than the full cluster's.

Inside MULTI/EXEC or a Lua script, no other nodes are queried and the LOCAL response is returned instead.

  • mode (string) Will have the value primary.
  • index_name (string) The index name
  • num_docs (string) INTEGER. Total keys in the index
  • num_records (string) INTEGER. Total records in the index
  • hash_indexing_failures (string) INTEGER. Number of field values that produced nothing to index when a key was first added: malformed values (for example a non-numeric NUMERIC value, a wrong-size VECTOR, or invalid UTF-8) and values that yield no tags.
  • attributes (array of arrays) One entry per declared attribute of the index.
    • identifier (string) identifier for this attribute
    • attribute (string) The name used to refer to this index in query and aggregation expressions.
    • user_indexed_memory (integer) Number of bytes of user data ingested into this field, summed across the primaries.
    • num_records (integer) Number of records indexed for this attribute, summed across the primaries.
  • index_fingerprint (integer) Fingerprint of the index definition on the node that executes the command. Only present when search.info-developer-visible is yes; intended for debugging.
  • index_version (integer) Version of the index definition on the node that executes the command. Only present when search.info-developer-visible is yes; intended for debugging.

Response when the CLUSTER option is specified#

An array of key value pairs

Totals, minimums and maximums are computed over the nodes that responded. With SOMESHARDS, a node that does not respond is omitted, so totals may be lower than the full cluster's.

Inside MULTI/EXEC or a Lua script, no other nodes are queried and the LOCAL response is returned instead.

  • mode (string) Will have the value cluster.
  • index_name (string) The index name
  • backfill_in_progress (string) 0 or 1. Is backfill in progress
  • backfill_complete_percent_max (string) FLOAT32. Maximum backfill complete percent in all nodes
  • backfill_complete_percent_min (string) FLOAT32. Minimum backfill complete percent in all nodes
  • state (string) The current state of the index, one of: ready, backfill_in_progress or backfill_paused_by_oom
  • attributes (array of arrays) One entry per declared attribute of the index.
    • identifier (string) identifier for this attribute
    • attribute (string) The name used to refer to this index in query and aggregation expressions.
    • user_indexed_memory (integer) Number of bytes of user data ingested into this field, summed across all nodes, primaries and replicas.

History#

Version Change
1.2.0

Added Text Indexing and Search support

1.3.0

Reports the index FILTER, filter_rejected_keys, and per-attribute SORTABLE and UNF. Reports non-English language values. With search.emulate-release 1.3.0 or later, also reports the configured SCORE as a double and SCORE_FIELD