On Wed, Dec 16, 2009 at 12:39 PM, patrick o'leary <pj...@pjaol.com> wrote:
> Yeah.. can't release that part mate, all you need is > > package com.pjaol; > > import org.apache.lucene.queryParser.ParseException; > import org.apache.solr.search.FunctionQParser; > import org.apache.solr.search.ValueSourceParser; > import org.apache.solr.search.function.ValueSource; > > public class CustomValueSourceParser extends ValueSourceParser{ > > @Override > public ValueSource parse(FunctionQParser fp) throws ParseException { > > System.out.println("******* Called"); > return null; > } > > } > > > And > <valueSourceParser name="social_a" > class="com.pjaol.CustomValueSourceParser" > /> > in your solrconfig.xml > > The parse method only gets called at query time > > Patrick, this works for me. The string is printed in the console. Your runtime classpath must have Solr 1.3 jars somewhere because the ValueSourceParser#init was abstract in 1.3 http://svn.apache.org/repos/asf/lucene/solr/branches/branch-1.3/src/java/org/apache/solr/search/ValueSourceParser.java -- Regards, Shalin Shekhar Mangar.