I've got a Lucene-based search implementation which searches over documents
in a CMS and weeds out those hits which aren't accessible to the user
carrying out the search. The raw search results are returned as an
iterator, and I wrap another iterator around this to silently consume the
inaccessible hits. (Yes, I know... wasteful!) The search is therefore
based on data (user permissions) which can't be known at indexing time.
I'm now porting the search implementation over to Solr. I took a look at
FunctionQuery, and wondered if there was some way I could use it to do this
kind of filtering - but as far as I can tell, it's only about scoring a hit
- ValueSource can't signal 'don't include this at all'. Is there a case for
introducing some kind of boolean include/exclude factor somewhere along the
API? Or is there another obvious way to do this? I guess I could implement
my own Query subclass and use it as a filter [query] in the search, but I
wonder if it would be still be useful in FunctionQuery.
Jon