lucene-solr-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Matt Mitchell <>
Subject Re: Question about extending a response writer
Date Fri, 18 Dec 2009 17:31:36 GMT
Thanks Erik! I wasn't able to solve my problem unfortunately. I had a closer
look at the mlt component and handler. That does seem like the right place
to put it, but I can't find a way to add a custom fl for the mlt docs. It
would seem as though the response writers' writeDocList method accepts a
"fields" argument which is used for all documents. Is that the case?

I'll continue messing with this - in a less rogue way ;) and if I come up
with something useful I'd be glad to contribute it!


On Thu, Dec 17, 2009 at 1:31 PM, Erik Hatcher <>wrote:

> Matt,
> I'm not sure if this will help - but pull your definition of MLTRubyWriter
> outside of MLTRubyResponseWriter (look at for hot is
> done there).  RubyWriter isn't public, but you're using the same package so
> it should work.
> Also, of course you know this, but extending the response writers for this
> sort of thing is not really the way to go.  What needs to happen is the
> MoreLikeThisComponent should be adjusted to have a way to override the
> default field list from fl.  If you build it this way, it'd be something we
> could add to Solr and support in the core, versus your unsupported rogue way
> :)
>        Erik
> On Dec 17, 2009, at 10:13 AM, Matt Mitchell wrote:
>  Hi,
>> I'm pretty new solr internals, but have been experimenting with good
>> results... up to now!
>> What I'm trying to do is make it possible for the mlt docs to have their
>> own
>> custom fl, separate from the main docs fl. I'm only interested in the ruby
>> response at this point. So the only way I've found to do this is to create
>> a
>> new query response writer, which extends the ruby response writer and make
>> a
>> few changes:
>> This class compiles fine. I put my "mlt-ruby-response-writer.jar" within
>> my
>> solr-home/lib dir, and registered the response writer. Solr starts up
>> without errors.
>> ... but when I run it within Solr I get an error:
>> class org.apache.solr.request.MLTRubyResponseWriter$MLTRubyWriter
>> cannot access its superclass org.apache.solr.request.RubyWriter
>> java.lang.IllegalAccessError: class
>> org.apache.solr.request.MLTRubyResponseWriter$MLTRubyWriter cannot
>> access its superclass org.apache.solr.request.RubyWriter
>> Anyone have an idea to what I might be doing wrong? Why would I be able to
>> compile, but then get a runtime error like that? Is this a classpath
>> thing?
>> Oh, the error occurs when I make a request and specify the wt, which I
>> named
>> "mltrb".
>> Thanks,
>> Matt

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