On Jul 30, 2014, at 20:37 , Peter Karman <[email protected]> wrote:

> Nick Wellnhofer wrote on 7/30/14 1:27 PM:
> 
>> I can see two solutions.
>> 
>> A. Keep the Perl wrapper possibly using different names for the original
>> method and the wrapper. Unfortunately, this wouldn’t be backward compatible.
>> At least, we could choose whether to break either implementors or users of
>> ‘make_compiler’.
>> 
>> B. Emulate the default value on the C level, for example by using a special
>> float constant to signal that the default should be used:
>> 
>> public abstract incremented Compiler* Make_Compiler(Query *self, Searcher
>> *searcher, float boost = special_value, bool subordinate = false);
> 
> Or (C) (which Nick suggested to me on irc) is making 'boost' a required param,
> which means the method signature changes but not the method name. I like that 
> best.

Here’s the only place I could find from a quick look where a change would be 
required:

https://github.com/karpet/lucyx-search-nulltermquery/blob/master/lib/LucyX/Search/AnyTermCompiler.pm#L121

In this case, it seems that the parent query’s boost should be passed to the 
child query. The cases where Make_Compiler is invoked on a “root” query are 
probably mostly handled from the C code so making the ‘boost’ parameter 
required might actually be beneficial because it forces custom query authors to 
think about passing it on.

Nick

Reply via email to