we need tests about handling of potential duplicate entries in indexes

Bug #1004438 reported by Samuele Pedroni
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
U1DB
Confirmed
Medium
Unassigned

Bug Description

right now it seems we dedupe duplicates index keys in indexes at the sql level at least, that's probably the behavior we want but there are no tests specifying and checking for this

Revision history for this message
Stuart Langridge (sil) wrote :

We need to decide whether a document can exist twice in the same index with the same index key, or not, and then enforce that behaviour with tests.

Ways a document might show up twice:

create_index("words", "splitwords(colours)")
document: { colours: "red red red green blue" }
Should this document be in the index three times (one for each of "red", "green", "blue") or five?

create_index("name", "names")
document: { names: [ "aaron", "aaron", "andrew" ] }
Should this document be in the index twice (one for each of "aaron" and "andrew" ) or three times?

I personally think that indexes should be deduped: there should not be two identical entries (that is, two identical (indexkey, doc) pairs) in an index.

Rick McBride (rmcbride)
Changed in u1db:
status: New → Confirmed
assignee: nobody → Eric Casteleijn (thisfred)
Changed in u1db:
assignee: Eric Casteleijn (thisfred) → nobody
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.