Incrementing a Mapper version number causes duplicate entries


Using CBL for Android 1.3.1

I have a view with a Mapper that indexes on a text field within the document. I changed the logic slightly (sometimes I was transforming the field I used as the key before emitting it), and incremented the version. I noticed that when I ran the View the next time, one document (at least, I suspect more) appeared in the results twice. For fun, I incremented the version number twice more without making any changes to the Mapper, and each time, one more copy of the document appeared in the result. The only interesting thing about the key was that it contained only CJK characters, as it’s a Chinese name.

I called View.deleteIndex() and that removed the duplicates upon regeneration of the index.

Is this a known problem?

Ah. Here’s the complete set of keys that end up being duplicated. I think we can see the common feature:

W/ContactMgr: Duplicate doc 2a7ff561-28aa-4d73-bd29-cb9eafd827fc Boglárka Dér
W/ContactMgr: Duplicate doc cb21d08d-a918-423a-9d06-abe68a786a2b Boglárka Tóth
W/ContactMgr: Duplicate doc a0539b9f-e0bd-4d7a-bde4-e13df9b26319 György Móra
W/ContactMgr: Duplicate doc 980c7774-e209-4243-b53f-93df814a1039 Jude and Barn Lavelle
W/ContactMgr: Duplicate doc dfd0eea5-fd07-4ca8-8b56-4cda877861e2 Monterey Books李光慧
W/ContactMgr: Duplicate doc 4558a45c-0706-45a6-82aa-bbed2c1d6f6a Specialty’s Café & Bakery
W/ContactMgr: Duplicate doc 3cb35571-956a-43af-bc16-299dea594a6e TradingJungle™ - Amazon Marketplace
W/ContactMgr: Duplicate doc cb6c05ee-df84-4979-9c94-b2cdbdca1b76 刘劲宇

Jude and Barn Lavelle is a bit of a mystery, since it doesn’t appear to contain any non-ASCII characters.

Hi @pcockerell,

It seems bug with CJK. Could you please file the ticket with map function and sample data?


More than just CJK, but sure, will do!

Oops, it turned someone had accidentally reverted us to use 1.2.1. When I fixed that and started using 1.3.1 again, the problem went away. Sorry about that!