FT.INFO

Syntax

  1. FT.INFO index

Time complexity: O(1)

Important: New in Dragonfly v1.13. Currently, Dragonfly Search is in Beta.

Description

Return information and statistics on the index.

Required arguments

index

is index name. You must first create the index using FT.CREATE.

Return

FT.INFO returns an array reply with pairs of keys and values.

Returned values include:

  • index_name: name of the index upon creation by using FT.CREATE.
  • fields: index schema - field names, types, and attributes.
  • num_docs: Number of documents in the index.

Examples

Return statistics about an index

  1. dragonfly> HSET blog:post:1 title "blog post 1" published_at 1701210030 category "default" description "this is a blog"
  2. (integer) 4
  3. dragonfly> FT.CREATE idx ON HASH PREFIX 1 blog:post: SCHEMA title TEXT SORTABLE published_at NUMERIC SORTABLE category TAG SORTABLE description TEXT NOINDEX
  4. OK
  5. dragonfly> FT.INFO idx
  6. 1) index_name
  7. 2) idx
  8. 3) fields
  9. 4) 1) 1) identifier
  10. 2) published_at
  11. 3) attribute
  12. 4) published_at
  13. 5) type
  14. 6) NUMERIC
  15. 2) 1) identifier
  16. 2) title
  17. 3) attribute
  18. 4) title
  19. 5) type
  20. 6) TEXT
  21. 3) 1) identifier
  22. 2) category
  23. 3) attribute
  24. 4) category
  25. 5) type
  26. 6) TAG
  27. 4) 1) identifier
  28. 2) description
  29. 3) attribute
  30. 4) description
  31. 5) type
  32. 6) TEXT
  33. 5) num_docs
  34. 6) (integer) 1

See also

FT.CREATE | FT.SEARCH