lucene-solr-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Shalin Shekhar Mangar <shalinman...@gmail.com>
Subject Re: ValueSourceParser problem
Date Wed, 16 Dec 2009 07:40:27 GMT
On Wed, Dec 16, 2009 at 12:39 PM, patrick o'leary <pjaol@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.

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message