On 9/6/07, Jonathan Woods <[EMAIL PROTECTED]> wrote: > As a quick sideline to the discussion on FunctionQueries (which is way > beyond me): would it not be useful for a FunctionQuery to be able to exclude > hits (using that term loosely) as well as to affect their score? Can/should > the current framework do that? > > I ask because I want to exclude hits on the basis of their availability, > where 'availability' is to do with user permissions and in general can only > be determined at query time. > I tried writing a Filter to do the same job, > but couldn't find a general way to avoid having the availability criterion > assessed over all documents in the index - and it's prohibitively expensive > to evaluate.
Can you give examples of what the queries look like (assuming they are expressible in lucene query syntax)? fq params often work pretty well since they are cached and reused (hence the cost of going across the whole index is only paid once). A FunctionQuery would have some of the same issues... building the FieldCache entry the first time is relatively expensive. -Yonik