Back to Redis

FT.INFO

content/commands/ft.info.md

latest11.3 KB
Original Source

Returns information and statistics about a given index.

Required arguments

index

is the name of the given index. You must first create the index using [FT.CREATE]({{< relref "commands/ft.create/" >}}). You can also use an alias of index created using [FT.ALIASADD]({{< relref "commands/ft.aliasadd/" >}}) or [FT.ALIASUPDATE]({{< relref "commands/ft.aliasupdate/" >}}).

Returned values

General

Return field nameDefinition
index_nameThe index name that was defined when index was created.
index_optionsThe index options selected during FT.CREATE such as FILTER {filter}, LANGUAGE {default_lang}, etc.
index_definitionIncludes key_type, hash or JSON; prefixes, if any; and default_score.
attributesThe index schema field names, types, and attributes.
num_docsThe number of documents.
max_doc_idThe maximum document ID.
num_termsThe number of distinct terms.
num_recordsThe total number of records.

Various size statistics

StatisticDefinition
inverted_sz_mbThe memory used by the inverted index, which is the core data structure used for searching in RediSearch. The size is given in megabytes.
vector_index_sz_mbThe memory used by the vector index, which stores any vectors associated with each document.
total_inverted_index_blocksThe total number of blocks in the inverted index.
offset_vectors_sz_mbThe memory used by the offset vectors, which store positional information for terms in documents.
doc_table_size_mbThe memory used by the document table, which contains metadata about each document in the index.
sortable_values_size_mbThe memory used by sortable values, which are values associated with documents and used for sorting purposes.
key_table_size_mbThe memory used by the key table, which stores the mapping between document IDs and Redis keys.
geoshapes_sz_mbThe memory used by GEO-related fields.
records_per_doc_avgThe average number of records (including deletions) per document.
bytes_per_record_avgThe average size of each record in bytes.
offsets_per_term_avgThe average number of offsets (position information) per term.
offset_bits_per_record_avgThe average number of bits used for offsets per record.
tag_overhead_sz_mbThe size of the TAG index structures used for optimising performance.
text_overhead_sz_mbThe size of the TEXT index structures used for optimising performance.
total_index_memory_sz_mbThe total memory consumed by all indexes in the DB.
StatisticDefinition
hash_indexing_failuresThe number of failures encountered during indexing.
total_indexing_timeThe cumulative wall-clock time spent indexing documents in ms.
indexingIndicates whether the index is currently being generated.
percent_indexedThe percentage of the index that has been successfully generated (1 means 100%).
number_of_usesThe number of times the index has been used.
cleaningThe index deletion flag. A value of 1 indicates index deletion is in progress.

Garbage collection statistics

StatisticDefinition
bytes_collectedThe number of bytes collected during garbage collection.
total_ms_runThe total time in milliseconds spent on garbage collection.
total_cyclesThe total number of garbage collection cycles.
average_cycle_time_msThe average time in milliseconds for each garbage collection cycle. The value nan indicates that the average cycle time is not available.
last_run_time_msThe time in milliseconds taken by the last garbage collection run.

The next two GC-related fields are relevant in scenarios where simultaneous changes occurred in the same memory area for both the parent process and the child process, resulting in the parent discarding these changes.

StatisticDefinition
gc_numeric_trees_missedThe number of numeric tree nodes whose changes were discarded due to splitting by the parent process during garbage collection.
gc_blocks_deniedThe number of blocks whose changes were discarded (skipped) because they were modified by the parent process during the garbage collection. Notably, as inverted index blocks are append-only, only the last block of an inverted index can be skipped.

Cursor statistics

StatisticDefinition
global_idleThe number of idle cursors in the system.
global_totalThe total number of cursors in the system.
index_capacityThe maximum number of cursors allowed per index.
index_totalThe total number of cursors open on the index.

Other statistics

  • Dialect statistics: the number of times the index was searched using each DIALECT, 1 - 4.
  • Index error statistics, including indexing failures, last indexing error, and last indexing error key.
  • Field statistics, including indexing failures, last indexing error, and last indexing error key for each schema field.

Example

<details open> <summary><b>Return statistics about an index</b></summary>

{{< highlight bash >}} 127.0.0.1:6379> ft.info idx:bicycle

  1. index_name
  2. idx:bicycle
  3. index_options
  4. (empty array)
  5. index_definition
    1. key_type
    2. JSON
    3. prefixes
      1. bicycle:
    4. default_score
    5. "1"
  6. attributes
      1. identifier
      2. $.pickup_zone
      3. attribute
      4. pickup_zone
      5. type
      6. GEOSHAPE
      7. coord_system
      8. SPHERICAL
      1. identifier
      2. $.store_location
      3. attribute
      4. store_location
      5. type
      6. GEO
      1. identifier
      2. $.brand
      3. attribute
      4. brand
      5. type
      6. TEXT
      7. WEIGHT
      8. "1"
      1. identifier
      2. $.model
      3. attribute
      4. model
      5. type
      6. TEXT
      7. WEIGHT
      8. "1"
      1. identifier
      2. $.description
      3. attribute
      4. description
      5. type
      6. TEXT
      7. WEIGHT
      8. "1"
      1. identifier
      2. $.price
      3. attribute
      4. price
      5. type
      6. NUMERIC
      1. identifier
      2. $.condition
      3. attribute
      4. condition
      5. type
      6. TAG
      7. SEPARATOR
      8. ,
  7. num_docs
  8. "10"
  9. max_doc_id
  10. "10"
  11. num_terms
  12. "546"
  13. num_records
  14. "692"
  15. inverted_sz_mb
  16. "0.003993034362792969"
  17. vector_index_sz_mb
  18. "0"
  19. total_inverted_index_blocks
  20. "551"
  21. offset_vectors_sz_mb
  22. "7.047653198242188e-4"
  23. doc_table_size_mb
  24. "7.152557373046875e-4"
  25. sortable_values_size_mb
  26. "0"
  27. key_table_size_mb
  28. "3.0422210693359375e-4"
  29. geoshapes_sz_mb
  30. "0.00426483154296875"
  31. records_per_doc_avg
  32. "69.19999694824219"
  33. bytes_per_record_avg
  34. "6.0505781173706055"
  35. offsets_per_term_avg
  36. "1.0679190158843994"
  37. offset_bits_per_record_avg
  38. "8"
  39. hash_indexing_failures
  40. "0"
  41. total_indexing_time
  42. "4.539999961853027"
  43. indexing
  44. "0"
  45. percent_indexed
  46. "1"
  47. number_of_uses
  48. (integer) 1
  49. cleaning
  50. (integer) 0
  51. gc_stats
    1. bytes_collected
    2. "0"
    3. total_ms_run
    4. "0"
    5. total_cycles
    6. "0"
    7. average_cycle_time_ms
    8. "nan"
    9. last_run_time_ms 10) "0" 11) gc_numeric_trees_missed 12) "0" 13) gc_blocks_denied 14) "0"
  52. cursor_stats
    1. global_idle
    2. (integer) 0
    3. global_total
    4. (integer) 0
    5. index_capacity
    6. (integer) 128
    7. index_total
    8. (integer) 0
  53. dialect_stats
    1. dialect_1
    2. (integer) 0
    3. dialect_2
    4. (integer) 0
    5. dialect_3
    6. (integer) 0
    7. dialect_4
    8. (integer) 0
  54. Index Errors
    1. indexing failures
    2. (integer) 0
    3. last indexing error
    4. N/A
    5. last indexing error key
    6. "N/A"
  55. field statistics
      1. identifier
      2. $.pickup_zone
      3. attribute
      4. pickup_zone
      5. Index Errors
        1. indexing failures
        2. (integer) 0
        3. last indexing error
        4. N/A
        5. last indexing error key
        6. "N/A"
      1. identifier
      2. $.store_location
      3. attribute
      4. store_location
      5. Index Errors
        1. indexing failures
        2. (integer) 0
        3. last indexing error
        4. N/A
        5. last indexing error key
        6. "N/A"
      1. identifier
      2. $.brand
      3. attribute
      4. brand
      5. Index Errors
        1. indexing failures
        2. (integer) 0
        3. last indexing error
        4. N/A
        5. last indexing error key
        6. "N/A"
      1. identifier
      2. $.model
      3. attribute
      4. model
      5. Index Errors
        1. indexing failures
        2. (integer) 0
        3. last indexing error
        4. N/A
        5. last indexing error key
        6. "N/A"
      1. identifier
      2. $.description
      3. attribute
      4. description
      5. Index Errors
        1. indexing failures
        2. (integer) 0
        3. last indexing error
        4. N/A
        5. last indexing error key
        6. "N/A"
      1. identifier
      2. $.price
      3. attribute
      4. price
      5. Index Errors
        1. indexing failures
        2. (integer) 0
        3. last indexing error
        4. N/A
        5. last indexing error key
        6. "N/A"
      1. identifier
      2. $.condition
      3. attribute
      4. condition
      5. Index Errors
        1. indexing failures
        2. (integer) 0
        3. last indexing error
        4. N/A
        5. last indexing error key
        6. "N/A" {{< / highlight >}}
</details>

Redis Software and Redis Cloud compatibility

| Redis Software | Redis Cloud Flexible & Annual | Redis Cloud Free & Fixed | <span style="min-width: 9em; display: table-cell">Notes</span> | |:----------------------|:-----------------|:-----------------|:------| | <span title="Supported">✅ Supported</span> | <span title="Supported">✅ Supported</span> | <span title="Supported">✅ Supported</nobr></span> | |

Return information

{{< multitabs id="ft-info-return-info" tab1="RESP2" tab2="RESP3" >}}

One of the following:

  • [Array]({{< relref "/develop/reference/protocol-spec#arrays" >}}) of key-value pairs containing index information and statistics.
  • [Simple error reply]({{< relref "/develop/reference/protocol-spec#simple-errors" >}}) in these cases: no such index.

-tab-sep-

One of the following:

  • [Map]({{< relref "/develop/reference/protocol-spec#maps" >}}) containing index information and statistics as key-value pairs.
  • [Simple error reply]({{< relref "/develop/reference/protocol-spec#simple-errors" >}}) in these cases: no such index.

{{< /multitabs >}}

See also

[FT.CREATE]({{< relref "commands/ft.create/" >}}) | [FT.SEARCH]({{< relref "commands/ft.search/" >}}) | [FT.ALIASADD]({{< relref "commands/ft.aliasadd/" >}}) | [FT.ALIASUPDATE]({{< relref "commands/ft.aliasupdate/" >}})

[RediSearch]({{< relref "/develop/ai/search-and-query/" >}})