I've now tried to write my own QueryResponseWriter plugin[1], as a maven
project depending on Solr Core 3.1, which is the same version of Solr I've
installed. It seems I'm not able to get rid of some cache.


$ xmlstarlet sel -t -c "/config/queryResponseWriter" conf/solrconfig.xml
<queryResponseWriter name="*xml*" class="org.apache.solr.request.*
XMLResponseWriter*"/>
<queryResponseWriter name="*Test*" class="com.mysimpatico.me.indexplugins.*
TestQueryResponseWriter*" default="true"/>

Restarted tomcat after changing solrconfig.xml and placing indexplugins.jar
in $SOLR_HOME/
At tomcat boot:
INFO: Adding 'file:/Users/simpatico/SOLR_HOME/lib/IndexPlugins.jar' to
classloader

I get legacy code of the plugin for both, and I don't understand why. At
least the xml should be different. Why could this be? How to find out?
http://localhost:8080/solr/select?q=apache&wt=Test and
http://localhost:8080/solr/select?q=apache&wt=xml
XML Parsing Error: syntax error
Location: http://localhost:8080/solr/select?q=apache&wt=xml (//Test
Line Number 1, Column 1:
foobarresponseHeaderstatusQTimeparamsqapachewtxmlresponse00foobar
^

It seems the new code for TestQueryResponseWriter[1] seems to never be
executed since i added a severe log statement that doesn't appear in tomcat
logs. Where are those caches?

Thank you in advance.

[1]
package com.mysimpatico.me.indexplugins;

import java.io.*;
import java.util.logging.Level;
import java.util.logging.Logger;
import org.apache.solr.request.XMLResponseWriter;


/**
 * Hello world!
 *
 */
public class TestQueryResponseWriter extends XMLResponseWriter{

    @Override
    public void write(Writer writer,
org.apache.solr.request.SolrQueryRequest request,
org.apache.solr.response.SolrQueryResponse response) throws IOException {

Logger.getLogger(TestQueryResponseWriter.class.getName()).log(Level.SEVERE,
"Hello from TestQueryResponseWriter");
        super.write(writer, request, response);
    }
}


On Thu, May 5, 2011 at 9:01 PM, Chris Hostetter <hossman_luc...@fucit.org>wrote:

>
> : $ xmlstarlet sel -t -c "/config/queryResponseWriter" conf/solrconfig.xml
> : <queryResponseWriter name="xml" class="org.apache.solr.request.*
> : XMLResponseWriter*" default="true"/>
> :
> : Now I comment the line in Solrconfix.xml, and there's no more writer.
> : $ xmlstarlet sel -t -c "/config/queryResponseWriter" conf/solrconfig.xml
> :
> : I make a query, and the XMLResponseWriter is still in charge.
> : *$ curl -L http://localhost:8080/solr/select?q=apache*
> : <?xml version="1.0" encoding="UTF-8"?>
>
>         ...
>
> Your example request is not specifying a "wt" param.
>
> in addition to the response writers declared in your solrconfig.xml, there
> are response writers that exist implicitly unless you define your own
> instances that override those names (xml, json, python, etc...)
>
> the real question is: what writer do you *want* to have used when no wt is
> specified?
>
> whatever the answer is: declare n instance of that writer with
> default="true" in your solrconfig.xml
>
>
> -Hoss
>



-- 
Regards,
K. Gabriele

--- unchanged since 20/9/10 ---
P.S. If the subject contains "[LON]" or the addressee acknowledges the
receipt within 48 hours then I don't resend the email.
subject(this) ∈ L(LON*) ∨ ∃x. (x ∈ MyInbox ∧ Acknowledges(x, this) ∧ time(x)
< Now + 48h) ⇒ ¬resend(I, this).

If an email is sent by a sender that is not a trusted contact or the email
does not contain a valid code then the email is not received. A valid code
starts with a hyphen and ends with "X".
∀x. x ∈ MyInbox ⇒ from(x) ∈ MySafeSenderList ∨ (∃y. y ∈ subject(x) ∧ y ∈
L(-[a-z]+[0-9]X)).

Reply via email to