I am trying to set up document-level security for my index. The documents 
have fields which will be filtered on to enforce access permissions. 

My question is: given a query, is it possible to set things up so that ES 
will invoke a custom script filter on *every* clause in said query without 
having to munge the query myself to insert the filter explicitly? 

For example, if a query is: 

filtered: { 
    query: { 
       term: { foo: "bar" } 
    }, 
    filter: { 
       has_parent: { 
          type: "some_type", 
          query: { 
             term: { blah: "xyz" } 
          } 
      } 
   } 
} 

then, I would want my custom filter invoked (implicitly) on both term 
queries above. 
Is there an alternative to doing the above without preprocessing the query 
and explicitly inserting my custom filter everywhere? 

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/elasticsearch/80f569b4-efca-4c46-a028-0220cfb61375%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to