FT.SEARCH idx "foo" works but FT.SEARCH idx "food" hangs Redis

Hello! My team is running into an issue with a larger redisearch dataset. We are running this image: redislabs/redisearch:1.4.28, which is redis 6.0.1. The following query runs fine:

localhost:42017> ft.search fixmyzonar-latest "foo"
1) (integer) 0

Interestingly, the following query causes redis to hang:

localhost:42017> ft.search fixmyzonar-latest "food"
^C

I would expect that if foo returned no results, there is no reason why food should behave differently?

FT.explain of these:

localhost:42017> ft.explaincli fixmyzonar-latest "food"
1) UNION {
2)   food
3)   <FT(expanded)
4)   +food(expanded)
5) }
6) 
localhost:42017> ft.explaincli fixmyzonar-latest "foo"
1) UNION {
2)   foo
3)   <F(expanded)
4)   +foo(expanded)
5) }
6) 

Output of FT.info:

localhost:42017> ft.info latest
 1) index_name
 2) latest
 3) index_options
 4) (empty list or set)
 5) fields
 6)  1) 1) account_name
        2) type
        3) TEXT
        4) WEIGHT
        5) "1"
        6) SORTABLE
     2) 1) account_code
        2) type
        3) TEXT
        4) WEIGHT
        5) "1"
        6) SORTABLE
     3) 1) trip_info_operator_fname
        2) type
        3) TEXT
        4) WEIGHT
        5) "1"
        6) SORTABLE
     4) 1) trip_info_operator_lname
        2) type
        3) TEXT
        4) WEIGHT
        5) "1"
        6) SORTABLE
     5) 1) asset_device_serial_number
        2) type
        3) TEXT
        4) WEIGHT
        5) "1"
        6) SORTABLE
     6) 1) asset_number
        2) type
        3) TEXT
        4) WEIGHT
        5) "1"
        6) SORTABLE
     7) 1) asset_vin
        2) type
        3) TEXT
        4) WEIGHT
        5) "1"
        6) SORTABLE
     8) 1) asset_license_number
        2) type
        3) TEXT
        4) WEIGHT
        5) "1"
        6) SORTABLE
     9) 1) asset_location_name
        2) type
        3) TEXT
        4) WEIGHT
        5) "1"
        6) SORTABLE
    10) 1) gps_type
        2) type
        3) TEXT
        4) WEIGHT
        5) "1"
        6) SORTABLE
    11) 1) tablet_type
        2) type
        3) TEXT
        4) WEIGHT
        5) "1"
        6) SORTABLE
    12) 1) asset_ld_serial_number
        2) type
        3) TEXT
        4) WEIGHT
        5) "1"
        6) SORTABLE
 7) num_docs
 8) "6925063"
 9) max_doc_id
10) "4308938603"
11) num_terms
12) "3714862"
13) num_records
14) "22168298"
15) inverted_sz_mb
16) "17592186044320.654"
17) offset_vectors_sz_mb
18) "52509.067291259766"
19) doc_table_size_mb
20) "620.35029029846191"
21) sortable_values_size_mb
22) "2363.5050554275513"
23) key_table_size_mb
24) "244.40084934234619"
25) records_per_doc_avg
26) "3.2011691445983956"
27) bytes_per_record_avg
28) "832122703949.10571"
29) offsets_per_term_avg
30) "2483.7155660754829"
31) offset_bits_per_record_avg
32) "8"
33) gc_stats
34)  1) bytes_collected
     2) "4405854"
     3) total_ms_run
     4) "546391"
     5) total_cycles
     6) "20"
     7) avarage_cycle_time_ms
     8) "27319.549999999999"
     9) last_run_time_ms
    10) "27710"
    11) gc_numeric_trees_missed
    12) "0"
    13) gc_blocks_denied
    14) "0"
35) cursor_stats
36) 1) global_idle
    2) (integer) 0
    3) global_total
    4) (integer) 0
    5) index_capacity
    6) (integer) 128
    7) index_total
    8) (integer) 0
(1.32s)

We have numerous other similar calls where some succeed while others cause this hanging behavior. There is nothing of note in debug redis logs. Any help or troubleshooting steps would be very helpful appreciated - at this point we are finding it quite difficult to pinpoint the nature of the issue. Also worth mentioning is that once the system hangs it is unrecoverable without a restart. Thank you!

It definitely looks like a bug, however the branch 1.4 of RediSearch is no more supported and won’t be fixed.
I would not be surprised that this have been fixed on 1.6 and 2.0 branches. You should consider upgrading to this latest version. And if the problem persists which this supported version to report it here again.

After bumping to 1.6.15 we are unable to reproduce the hanging so that is good. Of interest, we still get a discrepancy WRT result set with a simple query, not sure why:

localhost:42017> ft.search fixmyzonar-latest "foo" limit 0 1
1) (integer) 0
localhost:42017> ft.search fixmyzonar-latest "food" limit 0 1
1) (integer) 183

I am also on the same team as @dsnow1 and have found another peculiar problem after we have upgraded. It appears that and queries (at least according to the latest RedisSearch query syntax) doesn’t appear to function properly. We get no results found when using two properties that are true of a document that does work in ft.get but the corresponding ft.search returns 1) (integer) 0
Any ideas as to why it behaves in this way?

Can you share some information to help use reproducing the issue ? including a document sample (FT.ADD) the index (FT.CREATE) and the query ? (FT.SEARCH)

Yep, Here is the index

ft.info fixmyzonar-latest
 1) index_name
 2) fixmyzonar-latest
 3) index_options
 4) (empty array)
 5) fields
 6)  1) 1) account_name
        2) type
        3) TEXT
        4) WEIGHT
        5) "1"
        6) SORTABLE
     2) 1) account_code
        2) type
        3) TEXT
        4) WEIGHT
        5) "1"
        6) SORTABLE
     3) 1) trip_info_operator_fname
        2) type
        3) TEXT
        4) WEIGHT
        5) "1"
        6) SORTABLE
     4) 1) trip_info_operator_lname
        2) type
        3) TEXT
        4) WEIGHT
        5) "1"
        6) SORTABLE
     5) 1) asset_device_serial_number
        2) type
        3) TEXT
        4) WEIGHT
        5) "1"
        6) SORTABLE
     6) 1) asset_number
        2) type
        3) TEXT
        4) WEIGHT
        5) "1"
        6) SORTABLE
     7) 1) asset_vin
        2) type
        3) TEXT
        4) WEIGHT
        5) "1"
        6) SORTABLE
     8) 1) asset_license_number
        2) type
        3) TEXT
        4) WEIGHT
        5) "1"
        6) SORTABLE
     9) 1) asset_location_name
        2) type
        3) TEXT
        4) WEIGHT
        5) "1"
        6) SORTABLE
    10) 1) gps_type
        2) type
        3) TEXT
        4) WEIGHT
        5) "1"
        6) SORTABLE
    11) 1) tablet_type
        2) type
        3) TEXT
        4) WEIGHT
        5) "1"
        6) SORTABLE
    12) 1) asset_ld_serial_number
        2) type
        3) TEXT
        4) WEIGHT
        5) "1"
        6) SORTABLE
 7) num_docs
 8) "7030438"
 9) max_doc_id
10) "4384983956"
11) num_terms
12) "3721959"
13) num_records
14) "70392069"
15) inverted_sz_mb
16) "17592182279323.91"
17) total_inverted_index_blocks
18) "1777273"
19) offset_vectors_sz_mb
20) "53449.955299377441"
21) doc_table_size_mb
22) "2435.5522222518921"
23) sortable_values_size_mb
24) "9339.5577611923218"
25) key_table_size_mb
26) "248.11576843261719"
27) records_per_doc_avg
28) "10.012473191570709"
29) bytes_per_record_avg
30) "262057063409.96811"
31) offsets_per_term_avg
32) "796.20247780176157"
33) offset_bits_per_record_avg
34) "8"
35) gc_stats
36)  1) bytes_collected
     2) "1393398798321"
     3) total_ms_run
     4) "95502827"
     5) total_cycles
     6) "4963"
     7) avarage_cycle_time_ms
     8) "19242.963328631875"
     9) last_run_time_ms
    10) "21666"
    11) gc_numeric_trees_missed
    12) "0"
    13) gc_blocks_denied
    14) "3130563"
37) cursor_stats
38) 1) global_idle
    2) (integer) 0
    3) global_total
    4) (integer) 0
    5) index_capacity
    6) (integer) 128
    7) index_total
    8) (integer) 0

One of the documents I was searching through

127.0.0.1:7937> ft.get fixmyzonar-latest 1943_tes0703
 1) "asset_db_id"
 2) "1943"
 3) "account_code"
 4) "tes0703"
 5) "account_name"
 6) "Zonar R&D Test account"
 7) "account_dot_number"
 8) "123456789"
 9) "account_fs_number"
10) "None"
11) "asset_license_number"
12) "None"
13) "asset_rfid_number"
14) "None"
15) "asset_vin"
16) "None"
17) "asset_number"
18) "ZTrak_3163020292"
19) "asset_in_service_date"
20) "2013-11-27"
21) "asset_manufacturer"
22) "None"
23) "asset_external_id"
24) "None"
25) "asset_location_id"
26) "1"
27) "asset_mile_offset"
28) "None"
29) "asset_radio_address"
30) "None"
31) "asset_engine_hour_offset"
32) "None"
33) "asset_active"
34) "True"
35) "asset_power_unit_no"
36) "ZTrak_3163"
37) "asset_eld_set"
38) "None"
39) "asset_type"
40) "Standard"
41) "asset_subtype"
42) "None"
43) "asset_device_serial_number"
44) "3163020292"
45) "asset_location_name"
46) "Home"
47) "asset_speed_classification"
48) "Undefined"
49) "asset_hos_device_type"
50) "AOBRD"
51) "complex_device_type"
52) "ZTRAK"
53) "asset_description"
54) "None"
55) "fmz_cron_ts"
56) "2021-10-28T09:14:55.295078Z"
57) "gps_type"
58) "ZTRAK""

And if I compound search on the account code and DB ID

127.0.0.1:7937> ft.search fixmyzonar-latest "1943 tes"
1) (integer) 0
127.0.0.1:7937> ft.search fixmyzonar-latest "tes0703 1943"
1) (integer) 0