Can you add some fields that let set a filter or query that weed out the
results that the user doesn't have access too?

If its as simple as Admin versus User, you could have a boolean field
called AdminOnly, and when a User is querying, add a fq=[* TO *]
-AdminOnly:true

You could get more specific if you need to, just provide the information
that you would use to determine the availability of the record to any
given user, and then construct the filter based on the current user.

> -----Original Message-----
> From: Jonathan Woods [mailto:[EMAIL PROTECTED] 
> Sent: Monday, August 27, 2007 10:00 AM
> To: solr-user@lucene.apache.org
> Subject: Filtering using data only available at query time
> 
> 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
>  
> 

Reply via email to