RediSearch / RSCoordinator

RediSearch coordinator
Other
23 stars 10 forks source link

Inconsistent results on MacOS #253

Open a-dot opened 3 years ago

a-dot commented 3 years ago

Hi,

I launched a 3 shards redis oss cluster and loaded module-oss.so (v2.0.7) on all three. Connected to it and ran the "quick start" commands from RediSearch:

127.0.0.1:7000> ft._list
(empty array)
127.0.0.1:7000> FT.CREATE myIdx ON HASH PREFIX 1 doc: SCHEMA title TEXT WEIGHT 5.0 body TEXT url TEXT
(error) Index already exists
127.0.0.1:7000> ft._list
1) "myIdx"

That's my first issue... It's giving me an error that the index already exists even though it's a brand new instance with no index yet as you can see.

Here's an index of the index if it helps in any way:

127.0.0.1:7000> ft.info myIdx
 1) index_name
 2) "myIdx"
 3) index_definition
 4)  1) key_type
     2) HASH
     3) prefixes
     4) 1) doc:
     5) language_field
     6) __language
     7) default_score
     8) "1"
     9) score_field
    10) __score
    11) payload_field
    12) __payload
 5) fields
 6) 1) 1) title
       2) type
       3) TEXT
       4) WEIGHT
       5) "5"
    2) 1) body
       2) type
       3) TEXT
       4) WEIGHT
       5) "1"
    3) 1) url
       2) type
       3) TEXT
       4) WEIGHT
       5) "1"
 7) index_options
 8) (empty array)
 9) gc_stats
10) 1) bytes_collected
    2) (integer) 0
11) cursor_stats
12) 1) global_idle
    2) (integer) 0
    3) global_total
    4) (integer) 0
    5) index_capacity
    6) (integer) 640
    7) index_total
    8) (integer) 0
13) num_docs
14) (integer) 0
15) max_doc_id
16) (integer) 0
17) num_terms
18) (integer) 0
19) num_records
20) (integer) 0
21) inverted_sz_mb
22) "0"
23) offset_vectors_sz_mb
24) "0"
25) doc_table_size_mb
26) "0"
27) key_table_size_mb
28) "4.5442023927610081e+18"
29) records_per_doc_avg
30) "nan"
31) bytes_per_record_avg
32) "nan"
33) offsets_per_term_avg
34) "nan"
35) offset_bits_per_record_avg
36) "nan"
37) indexing
38) (integer) 0
39) percent_indexed
40) "1"
41) hash_indexing_failures
42) (integer) 0

The second issue is when I try to add a document:

127.0.0.1:7000> hset doc:1 title "hello world" body "lorem ipsum" url "http://redis.io"
(integer) 3
127.0.0.1:7000> FT.SEARCH myIdx "hello world" LIMIT 0 10
1) (integer) 2
2) "doc:1"
3) 1) "title"
   2) "hello world"
   3) "body"
   4) "lorem ipsum"
   5) "url"
   6) "http://redis.io"
4) "doc:1"
5) 1) "title"
   2) "hello world"
   3) "body"
   4) "lorem ipsum"
   5) "url"
   6) "http://redis.io"

It returns a duplicate of the same document.

Another issue is when I try to delete the index:

127.0.0.1:7000> ft._list
1) "myIdx"
127.0.0.1:7000> ft.dropindex myIdx
(error) Unknown Index name
127.0.0.1:7000> ft._list
(empty array)

Am I doing something wrong? Can you help me please?

Thanks!

ashtul commented 3 years ago

@a-dot Can you please share the order of commands you are running? Have you loaded the coordinator from the beginning and loaded the docs into it? Or did you load them first and then ran the coordinator?

a-dot commented 3 years ago

@a-dot Can you please share the order of commands you are running? Have you loaded the coordinator from the beginning and loaded the docs into it? Or did you load them first and then ran the coordinator?

@ashtul Hi,

I loaded the coordinator from a loadmodule line in each of the nodes config file. Then I started all three nodes clean. So the coordinator should have been running prior to any commands issued and any documents inserted.

As to the order of the commands it's the order I posted them in

ft._list
ft.create ...
ft._list 
ft.info ...
hset ...
ft.search ...
ft._list
ft.dropindex ...
ft._list

Thanks for the help!