I am implementing a custom Solr FieldType for Solr trunk.  One method I 
override is:
   Query getFieldQuery(QParser parser, SchemaField field, String externalVal)
My Query implementation can be vastly more efficient if the scores aren't 
needed vs. when they are needed.  My code constructing this is basically:
    Filter f = makeFilter(...);//efficient
    ValueSource vs = makeValueSource(...);//potentially not needed and uses 
memory
    return new FilteredQuery( new FunctionQuery(vs), f );
I would love to know when it is okay to return a ConstantScoreQuery wrapping my 
Filter so that I needn't bother with my ValueSource.  In my opinion, FieldType 
should have a getFieldFilter() method similar to getFieldQuery().  Perhaps a 
hint of some kind could be added to the QParser handed in -- a boolean flag or 
some special local-param to indicate the constant score to use.  Solr could 
perform this when the QParser is constructed for a Filter Query.

Thoughts?  Am I missing something?

~ David
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to