(NOTE: this discussion probably makes more sense on solr-dev.  future 
replies should probably go there, or in  SOLR-334.)

: The parser is a quick hack I threw together, and any value source
: factories should not be exposed to it.  It seems like either
: 1) a value source factory would expose the types it expects
: or
: 2) a value source factory would take a List<ValueSource> and throw a
: ParseException if it didn't get what it expected
: 
: Reflection might be fine if the cost of construction via reflection
: ends up being small compared to the parsing itself.

Another option is to assume that if people are writing their own 
ValueSoures and loading them into solr as plugins, they could write their 
"FunctionParser" subclass that knows about those ValueSoures and then 
register that FunctionParser -- the key being to make it easy to subclass 
a FunctionParser to add your own functions (without needing to cut/paste a 
tone of stuff like you do now)

To me the key differentiator between something like this, and something 
like Tokenizer/TokenFilter factories is that with those, you want to be 
able to mix/match them at run time a lot -- but i'm guessing once you 
write a ValueSource and you want the function parser to use whenever it 
sees "foo(...)" that's not something you really need to change with each 
Solr install (or have one function parser for one request handler, and a 
different one for another reuqest handler)




-Hoss

Reply via email to