You are viewing a plain text version of this content. The canonical link for it is here.
Posted to solr-user@lucene.apache.org by xavier jmlucjav <jm...@gmail.com> on 2013/04/03 22:22:41 UTC

do SearchComponents have access to response contents

I need to implement some SearchComponent that will deal with metrics on the
response. Some things I see will be easy to get, like number of hits for
instance, but I am more worried with this:

We need to also track the size of the response (as the size in bytes of the
whole xml response tat is streamed, with stored fields and all). I was a
bit worried cause I am wondering if a searchcomponent will actually have
access to the response bytes...

Can someone confirm one way or the other? We are targeting Sorl4.0

thanks
xavier

Re: do SearchComponents have access to response contents

Posted by xavier jmlucjav <jm...@gmail.com>.
I knew I could do that at jetty level with a servlet for instance, but the
user wants to do this stuff inside solr code itself. Now that you mention
the logs...that could be a solution without modifying the webapp...

thanks for the input!
xavier


On Fri, Apr 5, 2013 at 7:55 AM, Amit Nithian <an...@gmail.com> wrote:

> "We need to also track the size of the response (as the size in bytes of
> the
> whole xml response tat is streamed, with stored fields and all). I was a
> bit worried cause I am wondering if a searchcomponent will actually have
> access to the response bytes..."
>
> ==> Can't you get this from your container access logs after the fact? I
> may be misunderstanding something but why wouldn't mining the Jetty/Tomcat
> logs for the response size here suffice?
>
> Thanks!
> Amit
>
>
> On Thu, Apr 4, 2013 at 1:34 AM, xavier jmlucjav <jm...@gmail.com>
> wrote:
>
> > A custom QueryResponseWriter...this makes sense, thanks Jack
> >
> >
> > On Wed, Apr 3, 2013 at 11:21 PM, Jack Krupansky <jack@basetechnology.com
> > >wrote:
> >
> > > The search components can see the "response" as a namedlist, but it is
> > > only when SolrDispatchFIlter calls the QueryResponseWriter that XML or
> > JSON
> > > or whatever other format (Javabin as well) is generated from the named
> > list
> > > for final output in an HTTP response.
> > >
> > > You probably want a custom query response writer that wraps the XML
> > > response writer. Then you can generate the XML and then do whatever you
> > > want with it.
> > >
> > > The QueryResponseWriter class and <queryResponseWriter> in
> > solrconfig.xml.
> > >
> > > -- Jack Krupansky
> > >
> > > -----Original Message----- From: xavier jmlucjav
> > > Sent: Wednesday, April 03, 2013 4:22 PM
> > > To: solr-user@lucene.apache.org
> > > Subject: do SearchComponents have access to response contents
> > >
> > >
> > > I need to implement some SearchComponent that will deal with metrics on
> > the
> > > response. Some things I see will be easy to get, like number of hits
> for
> > > instance, but I am more worried with this:
> > >
> > > We need to also track the size of the response (as the size in bytes of
> > the
> > > whole xml response tat is streamed, with stored fields and all). I was
> a
> > > bit worried cause I am wondering if a searchcomponent will actually
> have
> > > access to the response bytes...
> > >
> > > Can someone confirm one way or the other? We are targeting Sorl4.0
> > >
> > > thanks
> > > xavier
> > >
> >
>

Re: do SearchComponents have access to response contents

Posted by Amit Nithian <an...@gmail.com>.
"We need to also track the size of the response (as the size in bytes of the
whole xml response tat is streamed, with stored fields and all). I was a
bit worried cause I am wondering if a searchcomponent will actually have
access to the response bytes..."

==> Can't you get this from your container access logs after the fact? I
may be misunderstanding something but why wouldn't mining the Jetty/Tomcat
logs for the response size here suffice?

Thanks!
Amit


On Thu, Apr 4, 2013 at 1:34 AM, xavier jmlucjav <jm...@gmail.com> wrote:

> A custom QueryResponseWriter...this makes sense, thanks Jack
>
>
> On Wed, Apr 3, 2013 at 11:21 PM, Jack Krupansky <jack@basetechnology.com
> >wrote:
>
> > The search components can see the "response" as a namedlist, but it is
> > only when SolrDispatchFIlter calls the QueryResponseWriter that XML or
> JSON
> > or whatever other format (Javabin as well) is generated from the named
> list
> > for final output in an HTTP response.
> >
> > You probably want a custom query response writer that wraps the XML
> > response writer. Then you can generate the XML and then do whatever you
> > want with it.
> >
> > The QueryResponseWriter class and <queryResponseWriter> in
> solrconfig.xml.
> >
> > -- Jack Krupansky
> >
> > -----Original Message----- From: xavier jmlucjav
> > Sent: Wednesday, April 03, 2013 4:22 PM
> > To: solr-user@lucene.apache.org
> > Subject: do SearchComponents have access to response contents
> >
> >
> > I need to implement some SearchComponent that will deal with metrics on
> the
> > response. Some things I see will be easy to get, like number of hits for
> > instance, but I am more worried with this:
> >
> > We need to also track the size of the response (as the size in bytes of
> the
> > whole xml response tat is streamed, with stored fields and all). I was a
> > bit worried cause I am wondering if a searchcomponent will actually have
> > access to the response bytes...
> >
> > Can someone confirm one way or the other? We are targeting Sorl4.0
> >
> > thanks
> > xavier
> >
>

Re: do SearchComponents have access to response contents

Posted by xavier jmlucjav <jm...@gmail.com>.
A custom QueryResponseWriter...this makes sense, thanks Jack


On Wed, Apr 3, 2013 at 11:21 PM, Jack Krupansky <ja...@basetechnology.com>wrote:

> The search components can see the "response" as a namedlist, but it is
> only when SolrDispatchFIlter calls the QueryResponseWriter that XML or JSON
> or whatever other format (Javabin as well) is generated from the named list
> for final output in an HTTP response.
>
> You probably want a custom query response writer that wraps the XML
> response writer. Then you can generate the XML and then do whatever you
> want with it.
>
> The QueryResponseWriter class and <queryResponseWriter> in solrconfig.xml.
>
> -- Jack Krupansky
>
> -----Original Message----- From: xavier jmlucjav
> Sent: Wednesday, April 03, 2013 4:22 PM
> To: solr-user@lucene.apache.org
> Subject: do SearchComponents have access to response contents
>
>
> I need to implement some SearchComponent that will deal with metrics on the
> response. Some things I see will be easy to get, like number of hits for
> instance, but I am more worried with this:
>
> We need to also track the size of the response (as the size in bytes of the
> whole xml response tat is streamed, with stored fields and all). I was a
> bit worried cause I am wondering if a searchcomponent will actually have
> access to the response bytes...
>
> Can someone confirm one way or the other? We are targeting Sorl4.0
>
> thanks
> xavier
>

Re: do SearchComponents have access to response contents

Posted by Jack Krupansky <ja...@basetechnology.com>.
The search components can see the "response" as a namedlist, but it is only 
when SolrDispatchFIlter calls the QueryResponseWriter that XML or JSON or 
whatever other format (Javabin as well) is generated from the named list for 
final output in an HTTP response.

You probably want a custom query response writer that wraps the XML response 
writer. Then you can generate the XML and then do whatever you want with it.

The QueryResponseWriter class and <queryResponseWriter> in solrconfig.xml.

-- Jack Krupansky

-----Original Message----- 
From: xavier jmlucjav
Sent: Wednesday, April 03, 2013 4:22 PM
To: solr-user@lucene.apache.org
Subject: do SearchComponents have access to response contents

I need to implement some SearchComponent that will deal with metrics on the
response. Some things I see will be easy to get, like number of hits for
instance, but I am more worried with this:

We need to also track the size of the response (as the size in bytes of the
whole xml response tat is streamed, with stored fields and all). I was a
bit worried cause I am wondering if a searchcomponent will actually have
access to the response bytes...

Can someone confirm one way or the other? We are targeting Sorl4.0

thanks
xavier