ieb/solr — Issue #94: Add support for filtering based on ACLs (read principals)
Author: ieb
Created: 2012-02-13 00:47:11+00:00
State: open

Currently where a user has lots of principals, the Solr query contains a structure like readerprincipal:( a OR b OR c ... OR zz)
That can quickly get so large as to a) be very expensive to process and b) be too big a query for Solr to cope with.

Converting that to filter_readerprincipal:a,b,c,d,e,...zz converts the query for reader principals into a single term.
Then compiling a filter bitmap and caching that bitmap inside Solr eliminates the expense of processing the filter every time.
Segments are immutable so the filter for each segment wont change. only the current segment will change before its committed.
Segments will change on an merge optimise step but that is reasonably rare.

For this to work we need to have a simple option to change the way in which the reader principals are added to a query.

Mark Triggs developed this approach, and so I will wait for a pull request from him before doing anything, rather than get it wrong.