How can I use the REPLACE PARTIAL to update a document?

Hello,

I clone source code and compile redisearch:

95427:M 22 Jan 2019 16:41:47.347 # Server initialized

95427:M 22 Jan 2019 16:41:47.348 * RediSearch version 1.4.2 (Git=v1.4.2-141-g18ea318e)

95427:M 22 Jan 2019 16:41:47.348 * concurrency: ON, gc: ON, prefix min length: 2, prefix max expansions: 200, query timeout (ms): 500, timeout policy: return, cursor read size: 1000, cursor max idle (ms): 300000, max doctable size: 1000000, search pool size: 20, index pool size: 8,

95427:M 22 Jan 2019 16:41:47.350 * Initialized thread pool!

95427:M 22 Jan 2019 16:41:47.350 * Module ‘ft’ loaded from ./redisearch.so

95427:M 22 Jan 2019 16:41:47.350 * Ready to accept connections

But the Partial update a document doesn’t work:

127.0.0.1:6379> FT.CREATE idx SCHEMA name TAG

OK

127.0.0.1:6379> FT.ADD idx doc1 0.8 FIELDS name “Harry Potter”

OK

127.0.0.1:6379> FT.ADD idx doc1 0.8 FIELDS name “Harry Potter” REPLACE PARTIAL

(error) Document already exists

Is this a bug? I also encounter some document that I cannot delete after changing its score.

Best,

Please try is like this:
FT.ADD idx doc1 0.8 REPLACE PARTIAL FIELDS name “Harry Potter”

Hi, thank you so much.

Thanks to your guidance, I was able to produce the bug that I cannot delete document from the index, please take a look:

127.0.0.1:6379> FT.ADD idx doc1 0.8 REPLACE PARTIAL FIELDS name “Harry Potter”

OK

127.0.0.1:6379> FT.ADD idx doc1 0.7 REPLACE PARTIAL FIELDS name “Harry Potter”

OK

127.0.0.1:6379> FT.DEL idx doc1

(integer) 1

127.0.0.1:6379> FT.GET idx doc1

  1. “name”

  2. “Harry Potter”

127.0.0.1:6379> FT.DEL idx doc1

(integer) 0

127.0.0.1:6379> FT.GET idx doc1

  1. “name”

  2. “Harry Potter”

127.0.0.1:6379>

best,

Vào 16:50:27 UTC+7 Thứ Ba, ngày 22 tháng 1 năm 2019, me...@redislabs.com đã viết:

Its not a bug, when you delete a document its only delete it from the index but it does not delete the content and this is why you find it with FT.GET.

Use the DD option to delete the content as well:
FT.DEL idx doc1 DD

I got it, thank you sooo much!

Vào 16:58:38 UTC+7 Thứ Ba, ngày 22 tháng 1 năm 2019, me...@redislabs.com đã viết: