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

4. dragonfly> FT.CREATE idx ON HASH PREFIX 1 blog:post: SCHEMA title TEXT SORTABLE published_at NUMERIC SORTABLE category TAG SORTABLE description TEXT NOINDEX
5. OK

7. dragonfly> FT.INFO idx
8. 1) index_name
9. 2) idx
10. 3) fields
11. 4) 1) 1) identifier
12. 2) published_at
13. 3) attribute
14. 4) published_at
15. 5) type
16. 6) NUMERIC
17. 2) 1) identifier
18. 2) title
19. 3) attribute
20. 4) title
21. 5) type
22. 6) TEXT
23. 3) 1) identifier
24. 2) category
25. 3) attribute
26. 4) category
27. 5) type
28. 6) TAG
29. 4) 1) identifier
30. 2) description
31. 3) attribute
32. 4) description
33. 5) type
34. 6) TEXT
35. 5) num_docs
36. 6) (integer) 1

See also

FT.CREATE | FT.SEARCH