Adaptive index on duplicate field names


I have a following document structure:

    "destination": { "city": "Allentown" },
    "origin": { "city": "New York" }

Trying to create an adaptive index:

CREATE INDEX ai_markets ON bucket 
(DISTINCT PAIRS({,, type})) 
WHERE type = "market";

Instead, what couchbase creates looks like this:

CREATE INDEX `ai_markets` ON `bucket`
((distinct (pairs({"city": (`origin`.`city`), "type": `type`})))) 
WHERE (`type` = "market")

So I only get to use this index with and not with

It looks like the matching field names are causing the problem here. Is there any way around this?

Object can have single unique field second one overrides first one.

Use secondary index vs adaptive index