added a comment - - edited I have the following collections structure:
b1.s1.c1
b1.s1.c2
where b1 is bucket, s1 is scope, c1 and c2 are collections
I have the following user:
name: b1s1c1
roles: Search Reader [b1:b1s1:b1s1c1]
So, this user can read from collection c1 and cannot read from collection c2.
I have multi-collection index on b1.s1.c1 and b1.s1.c2:
{
"name" : "b1s1c1b1s1c2" ,
"type" : "fulltext-index" ,
"params" : {
"doc_config" : {
"docid_prefix_delim" : "" ,
"docid_regexp" : "" ,
"mode" : "scope.collection.type_field" ,
"type_field" : "type"
},
"mapping" : {
"default_analyzer" : "standard" ,
"default_datetime_parser" : "dateTimeOptional" ,
"default_field" : "_all" ,
"default_mapping" : {
"dynamic" : true ,
"enabled" : false
},
"default_type" : "_default" ,
"docvalues_dynamic" : false ,
"index_dynamic" : true ,
"store_dynamic" : false ,
"type_field" : "_type" ,
"types" : {
"b1s1.b1s1c1" : {
"dynamic" : true ,
"enabled" : true
},
"b1s1.b1s1c2" : {
"dynamic" : true ,
"enabled" : true
}
}
},
"store" : {
"indexType" : "scorch" ,
"segmentVersion" : 15
}
},
"sourceType" : "gocbcore" ,
"sourceName" : "b1" ,
"sourceUUID" : "9a487e606d543ac9260c51d187fd7a29" ,
"sourceParams" : {},
"planParams" : {
"maxPartitionsPerPIndex" : 1024 ,
"indexPartitions" : 1 ,
"numReplicas" : 0
},
"uuid" : "7a766768cf03e582"
}
The following query fails for both pre and post fix builds:
curl -XPOST -u b1s1c1:password -H "Content-Type: application/json" http: //172.23.107.35:8094/api/index/b1s1c1b1s1c2/query -d '{"query": {"query": "click:to edit"}}'
with the same reason:
{
"message" : "Forbidden. User needs one of the following permissions" ,
"permissions" : [
"cluster.collection[b1:b1s1:b1s1c2].fts!read"
]
}
This is what I'm expecting to see
If I'm using targeted query:
curl -XPOST -u b1s1c1:password -H "Content-Type: application/json" http: //172.23.107.35:8094/api/index/b1s1c1b1s1c2/query -d '{"query": {"query": "click:to edit"}, "collections":["b1.s1.c1"]}'
or
curl -XPOST -u b1s1c1:password -H "Content-Type: application/json" http: //172.23.107.35:8094/api/index/b1s1c1b1s1c2/query -d '{"query": {"query": "click:to edit"}, "collections":["c1"]}'
or even
curl -XPOST -u b1s1c1:password -H "Content-Type: application/json" http: //172.23.107.35:8094/api/index/b1s1c1b1s1c2/query -d '{"query": {"query": "click:to edit"}, "collections":["default:b1.s1.c1"]}'
both, pre and post fix builds return this:
{
"status" : {
"total" : 1 ,
"failed" : 0 ,
"successful" : 1
},
"request" : {
"query" : {
"query" : "click:to edit"
},
"size" : 10 ,
"from" : 0 ,
"highlight" : null ,
"fields" : null ,
"facets" : null ,
"explain" : false ,
"sort" : [
"-_score"
],
"includeLocations" : false ,
"search_after" : null ,
"search_before" : null
},
"hits" : [],
"total_hits" : 0 ,
"max_score" : 0 ,
"took" : 132155 ,
"facets" : null
}
0 hits.
But if I'm using c1 index (single collection):
{
"name" : "b1s1c1" ,
"type" : "fulltext-index" ,
"params" : {
"doc_config" : {
"docid_prefix_delim" : "" ,
"docid_regexp" : "" ,
"mode" : "scope.collection.type_field" ,
"type_field" : "type"
},
"mapping" : {
"default_analyzer" : "standard" ,
"default_datetime_parser" : "dateTimeOptional" ,
"default_field" : "_all" ,
"default_mapping" : {
"dynamic" : true ,
"enabled" : false
},
"default_type" : "_default" ,
"docvalues_dynamic" : false ,
"index_dynamic" : true ,
"store_dynamic" : false ,
"type_field" : "_type" ,
"types" : {
"b1s1.b1s1c1" : {
"dynamic" : true ,
"enabled" : true
}
}
},
"store" : {
"indexType" : "scorch" ,
"segmentVersion" : 15
}
},
"sourceType" : "gocbcore" ,
"sourceName" : "b1" ,
"sourceUUID" : "9a487e606d543ac9260c51d187fd7a29" ,
"sourceParams" : {},
"planParams" : {
"maxPartitionsPerPIndex" : 1024 ,
"indexPartitions" : 1 ,
"numReplicas" : 0
},
"uuid" : "e2254c824c4d6749"
}
for the following query
curl -XPOST -u b1s1c1:password -H "Content-Type: application/json" http: //172.23.107.35:8094/api/index/b1s1c1/query -d '{"query": {"query": "click:to edit"}, "collections":["b1.s1.c1"]}'
I'm getting 1 hit, exactly as expected.
Forgot to mention: all collections including _default have 1 document.
Pre fix version used: 7.1.0-1000
Post fix version used: 7.1.0-1138
I have the following collections structure:
b1.s1.c1
b1.s1.c2
where b1 is bucket, s1 is scope, c1 and c2 are collections
I have the following user:
name: b1s1c1
roles: Search Reader [b1:b1s1:b1s1c1]
So, this user can read from collection c1 and cannot read from collection c2.
I have multi-collection index on b1.s1.c1 and b1.s1.c2:
{
},
},
},
}
}
},
}
},
},
}
The following query fails for both pre and post fix builds:
with the same reason:
{
]
}
This is what I'm expecting to see
If I'm using targeted query:
or
or even
both, pre and post fix builds return this:
{
},
},
],
},
}
0 hits.
But if I'm using c1 index (single collection):
{
},
},
}
}
},
}
},
},
}
for the following query
I'm getting 1 hit, exactly as expected.
Forgot to mention: all collections including _default have 1 document.
Pre fix version used: 7.1.0-1000
Post fix version used: 7.1.0-1138