These are my documents:
$ curl -XPUT 'http://localhost:9200/test/item/1' -d '{
"title" : "item 1",
"securitylevels" : [
{"usergroupcontentaccess" : [1,1,100]}
]
}'
$ curl -XPUT 'http://localhost:9200/test/item/2' -d '{
"title" : "item 2",
"securitylevels" : [
{ "usergroupcontentaccess" : [1,1,0] },
{ "usergroupcontentaccess" : [2,1,100] }
]
}'
Which says:
On item 1
group 1 has accesstype 1 and accesslevel 100
Which means that somebody in group 1 can view the item
and
On item 2
group 1 has accesstype 1 and accesslevel 0
group 2 has accesstype 1 and accesslevel 100
Which means that somebody in group 1 can not view the item and somebody
in group 2 can.
Now I like to query all the items someone in group 1 is allowed to view:
$ curl -XPOST 'http://localhost:9200/test/_search' -d '{
"query" : {
"filtered" : {
"query" : { "match_all" : {} },
"filter" : {
"terms" : { "securitylevels.usergroupcontentaccess" : [1,1,100],
"execution" : "and" }
}
}
}
}'
I expect only one result, e.g. item 1, but I get both.
Another approach:
$ curl -XPOST 'http://localhost:9200/test/_search' -d '{
"query" : {
"terms" : { "securitylevels.usergroupcontentaccess" : [1,1,100],
"minimum_match" : "3" }
}
}'
Gives me also both records.
What do I miss? I'm using ES 0.9.0RC2
--
You received this message because you are subscribed to the Google Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elasticsearch+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.