RediSearch 2.x - Incorrect indexing

Can somebody point out why below is not working? Never had this issue in RediSearch 1.6
Some indexing / docid issues. Tested on fresh install Redis 6.2.6 and RediSearch 2.2.5

redis> ft.create “test_idx” SCHEMA title TEXT WEIGHT 4.0 body TEXT
OK

redis> ft.add “test_idx” “test_idx:id:1” “1.0” “REPLACE” “FIELDS” “title” “MY TITLE” “body” “My contents”
OK

redis> ft.create “test_idx2” SCHEMA title TEXT WEIGHT 4.0 body TEXT
OK

redis> ft.add “test_idx2” “test_idx2:id:1” “1.0” “REPLACE” “FIELDS” “title” “MY TITLE 2” “body” “My contents 2”
OK

redis> ft.search test_idx2 ‘*’ limit 0 10

  1. (integer) 2
  2. “test_idx:id:1”
    1. “title”
    2. “MY TITLE”
    3. “body”
    4. “My contents”
  3. “test_idx2:id:1”
    1. “title”
    2. “MY TITLE 2”
    3. “body”
    4. “My contents 2”
      #######################

This is incorrect

#######################

redis> ft.drop “test_idx”
OK

redis> ft.create “test_idx” SCHEMA title TEXT WEIGHT 4.0 body TEXT
OK

redis> ft.add “test_idx” “test_idx:id:1” “1.0” “REPLACE” “FIELDS” “title” “MY TITLE” “body” “My contents”
OK

redis> ft.search test_idx ‘*’ limit 0 10

  1. (integer) 1
  2. “test_idx:id:1”
    1. “title”
    2. “MY TITLE”
    3. “body”
    4. “My contents”

redis> ft.search test_idx2 ‘*’ limit 0 10

  1. (integer) 1
  2. “test_idx:id:1”
    1. “title”
    2. “MY TITLE”
    3. “body”
    4. “My contents”
      #######################

This is incorrect

#######################

This has to do with FT.CREATE (without ON HASH PREFIX).
While the use of FT.ADD is deprecated and to be removed going forward in RediSearch 2.x. RediSearch 1.6 avoided the use of ON HASH PREFIX while using FT.ADD successfully.

Apparent now version 2 cannot just replace version 1 by only updating indices.
The documentation should reflect this issue and/or better just to remove those commands so as not to mislead in backwards compatibility.

Hello,
First, please note that you’re using deprecated commands ft.add and ft.drop - it’s better to use hset and ft.dropindex.
ft.add is actually translated into an hset, so your commands create two keys, which are both deleted when test_idx is dropped. Then test_idx:1 is re-created, hence the single result.
By using ft.dropindex the previously added keys will not be dropped.

Appreciate the clarification.

It should be well noted in the documentation 2.x is NOT backwards compatible with 1.6.
Thanks