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 Upayavira <uv...@odoko.co.uk> on 2016/05/26 14:31:24 UTC
Can a DocTransformer access the whole results tree?
Looking at the code for a sample DocTransformer, it seems that a
DocTransformer only has access to the document itself, not to the whole
results. Because of this, it isn't possible to use a DocTransformer to
merge, for example, the highlighting results into the main document.
Am I missing something?
Upayavira
Re: Can a DocTransformer access the whole results tree?
Posted by Stefan Matheis <ma...@gmail.com>.
Isn't that exactly what [explain] and [child] are doing? They locate
whatever data they're working on alongside the document it's related to
What Upayavira asks for looks the very same to me, doesn't it?
-Stefan
On May 27, 2016 7:27 PM, "Erick Erickson" <er...@gmail.com> wrote:
> Maybe you'd be better off using a custom search component.
> instead of a doc transformer. The intent of a doc transformer
> is, as you've discovered, working on single docs at a time. You
> want to manipulate the whole response which seems to fit more
> naturally into a search component. Make sure to put it after
> the highlight component (i.e. last-components).
>
> Best,
> Erick
>
> On Fri, May 27, 2016 at 6:55 AM, Upayavira <uv...@odoko.co.uk> wrote:
> > In a JSON response, we get this:
> >
> > {
> > "responseHeader": {...},
> > "response": { "docs": [...] },
> > "highlighting": {...}
> > ...
> > }
> >
> > I'm assuming that the getProcessedDocuments call would give me the docs:
> > {} element, whereas I'm after the whole response so I can retrieve the
> > "highlighting" element.
> >
> > Make sense?
> >
> > On Fri, 27 May 2016, at 02:45 PM, Mikhail Khludnev wrote:
> >> Upayavira,
> >>
> >> It's not clear what do you mean in "results themselves", perhaps you
> mean
> >> SolrDocuments ?
> >>
> >> public abstract class ResultContext {
> >> ..
> >> public Iterator<SolrDocument> getProcessedDocuments() {
> >> return new DocsStreamer(this);
> >> }
> >>
> >> On Fri, May 27, 2016 at 4:15 PM, Upayavira <uv...@odoko.co.uk> wrote:
> >>
> >> > Yes, I've seen that. I can see the getDocList() method will presumably
> >> > give me the results themselves, but I need the full response so I can
> >> > get the highlighting details, but I can't see them anywhere.
> >> >
> >> > On Thu, 26 May 2016, at 09:39 PM, Mikhail Khludnev wrote:
> >> > > public abstract class ResultContext {
> >> > >
> >> > > /// here are all results
> >> > > public abstract DocList getDocList();
> >> > >
> >> > > public abstract ReturnFields getReturnFields();
> >> > >
> >> > > public abstract SolrIndexSearcher getSearcher();
> >> > >
> >> > > public abstract Query getQuery();
> >> > >
> >> > > public abstract SolrQueryRequest getRequest();
> >> > >
> >> > > On Thu, May 26, 2016 at 11:25 PM, Upayavira <uv...@odoko.co.uk> wrote:
> >> > >
> >> > > > Hi Mikhail,
> >> > > >
> >> > > > Is there really? If I look at ResultContext, I see it is an
> abstract
> >> > > > class, completed by BasicResultContext. I don't see any context
> method
> >> > > > there. I can see a getContext() on SolrQueryRequest which just
> returns
> >> > a
> >> > > > hashmap. Will I find the response in there? Is that what you are
> >> > > > suggesting?
> >> > > >
> >> > > > Upayavira
> >> > > >
> >> > > > On Thu, 26 May 2016, at 06:28 PM, Mikhail Khludnev wrote:
> >> > > > > Hello,
> >> > > > >
> >> > > > > There is a protected ResultContext field named context.
> >> > > > >
> >> > > > > On Thu, May 26, 2016 at 5:31 PM, Upayavira <uv...@odoko.co.uk>
> wrote:
> >> > > > >
> >> > > > > > Looking at the code for a sample DocTransformer, it seems
> that a
> >> > > > > > DocTransformer only has access to the document itself, not to
> the
> >> > whole
> >> > > > > > results. Because of this, it isn't possible to use a
> >> > DocTransformer to
> >> > > > > > merge, for example, the highlighting results into the main
> >> > document.
> >> > > > > >
> >> > > > > > Am I missing something?
> >> > > > > >
> >> > > > > > Upayavira
> >> > > > > >
> >> > > > >
> >> > > > >
> >> > > > >
> >> > > > > --
> >> > > > > Sincerely yours
> >> > > > > Mikhail Khludnev
> >> > > > > Principal Engineer,
> >> > > > > Grid Dynamics
> >> > > > >
> >> > > > > <http://www.griddynamics.com>
> >> > > > > <mk...@griddynamics.com>
> >> > > >
> >> > >
> >> > >
> >> > >
> >> > > --
> >> > > Sincerely yours
> >> > > Mikhail Khludnev
> >> > > Principal Engineer,
> >> > > Grid Dynamics
> >> > >
> >> > > <http://www.griddynamics.com>
> >> > > <mk...@griddynamics.com>
> >> >
> >>
> >>
> >>
> >> --
> >> Sincerely yours
> >> Mikhail Khludnev
> >> Principal Engineer,
> >> Grid Dynamics
> >>
> >> <http://www.griddynamics.com>
> >> <mk...@griddynamics.com>
>
Re: Can a DocTransformer access the whole results tree?
Posted by Upayavira <uv...@odoko.co.uk>.
I was always under the impression that a search component couldn't
modify the output of a previous search component. If it can, then the
highlight component could add its results to the output of the query
component, and we're done.
Upayavira (who sees the confusion on people's faces often when he shows
them Solr highlighting)
On Fri, 27 May 2016, at 06:27 PM, Erick Erickson wrote:
> Maybe you'd be better off using a custom search component.
> instead of a doc transformer. The intent of a doc transformer
> is, as you've discovered, working on single docs at a time. You
> want to manipulate the whole response which seems to fit more
> naturally into a search component. Make sure to put it after
> the highlight component (i.e. last-components).
>
> Best,
> Erick
>
> On Fri, May 27, 2016 at 6:55 AM, Upayavira <uv...@odoko.co.uk> wrote:
> > In a JSON response, we get this:
> >
> > {
> > "responseHeader": {...},
> > "response": { "docs": [...] },
> > "highlighting": {...}
> > ...
> > }
> >
> > I'm assuming that the getProcessedDocuments call would give me the docs:
> > {} element, whereas I'm after the whole response so I can retrieve the
> > "highlighting" element.
> >
> > Make sense?
> >
> > On Fri, 27 May 2016, at 02:45 PM, Mikhail Khludnev wrote:
> >> Upayavira,
> >>
> >> It's not clear what do you mean in "results themselves", perhaps you mean
> >> SolrDocuments ?
> >>
> >> public abstract class ResultContext {
> >> ..
> >> public Iterator<SolrDocument> getProcessedDocuments() {
> >> return new DocsStreamer(this);
> >> }
> >>
> >> On Fri, May 27, 2016 at 4:15 PM, Upayavira <uv...@odoko.co.uk> wrote:
> >>
> >> > Yes, I've seen that. I can see the getDocList() method will presumably
> >> > give me the results themselves, but I need the full response so I can
> >> > get the highlighting details, but I can't see them anywhere.
> >> >
> >> > On Thu, 26 May 2016, at 09:39 PM, Mikhail Khludnev wrote:
> >> > > public abstract class ResultContext {
> >> > >
> >> > > /// here are all results
> >> > > public abstract DocList getDocList();
> >> > >
> >> > > public abstract ReturnFields getReturnFields();
> >> > >
> >> > > public abstract SolrIndexSearcher getSearcher();
> >> > >
> >> > > public abstract Query getQuery();
> >> > >
> >> > > public abstract SolrQueryRequest getRequest();
> >> > >
> >> > > On Thu, May 26, 2016 at 11:25 PM, Upayavira <uv...@odoko.co.uk> wrote:
> >> > >
> >> > > > Hi Mikhail,
> >> > > >
> >> > > > Is there really? If I look at ResultContext, I see it is an abstract
> >> > > > class, completed by BasicResultContext. I don't see any context method
> >> > > > there. I can see a getContext() on SolrQueryRequest which just returns
> >> > a
> >> > > > hashmap. Will I find the response in there? Is that what you are
> >> > > > suggesting?
> >> > > >
> >> > > > Upayavira
> >> > > >
> >> > > > On Thu, 26 May 2016, at 06:28 PM, Mikhail Khludnev wrote:
> >> > > > > Hello,
> >> > > > >
> >> > > > > There is a protected ResultContext field named context.
> >> > > > >
> >> > > > > On Thu, May 26, 2016 at 5:31 PM, Upayavira <uv...@odoko.co.uk> wrote:
> >> > > > >
> >> > > > > > Looking at the code for a sample DocTransformer, it seems that a
> >> > > > > > DocTransformer only has access to the document itself, not to the
> >> > whole
> >> > > > > > results. Because of this, it isn't possible to use a
> >> > DocTransformer to
> >> > > > > > merge, for example, the highlighting results into the main
> >> > document.
> >> > > > > >
> >> > > > > > Am I missing something?
> >> > > > > >
> >> > > > > > Upayavira
> >> > > > > >
> >> > > > >
> >> > > > >
> >> > > > >
> >> > > > > --
> >> > > > > Sincerely yours
> >> > > > > Mikhail Khludnev
> >> > > > > Principal Engineer,
> >> > > > > Grid Dynamics
> >> > > > >
> >> > > > > <http://www.griddynamics.com>
> >> > > > > <mk...@griddynamics.com>
> >> > > >
> >> > >
> >> > >
> >> > >
> >> > > --
> >> > > Sincerely yours
> >> > > Mikhail Khludnev
> >> > > Principal Engineer,
> >> > > Grid Dynamics
> >> > >
> >> > > <http://www.griddynamics.com>
> >> > > <mk...@griddynamics.com>
> >> >
> >>
> >>
> >>
> >> --
> >> Sincerely yours
> >> Mikhail Khludnev
> >> Principal Engineer,
> >> Grid Dynamics
> >>
> >> <http://www.griddynamics.com>
> >> <mk...@griddynamics.com>
Re: Can a DocTransformer access the whole results tree?
Posted by Erick Erickson <er...@gmail.com>.
Maybe you'd be better off using a custom search component.
instead of a doc transformer. The intent of a doc transformer
is, as you've discovered, working on single docs at a time. You
want to manipulate the whole response which seems to fit more
naturally into a search component. Make sure to put it after
the highlight component (i.e. last-components).
Best,
Erick
On Fri, May 27, 2016 at 6:55 AM, Upayavira <uv...@odoko.co.uk> wrote:
> In a JSON response, we get this:
>
> {
> "responseHeader": {...},
> "response": { "docs": [...] },
> "highlighting": {...}
> ...
> }
>
> I'm assuming that the getProcessedDocuments call would give me the docs:
> {} element, whereas I'm after the whole response so I can retrieve the
> "highlighting" element.
>
> Make sense?
>
> On Fri, 27 May 2016, at 02:45 PM, Mikhail Khludnev wrote:
>> Upayavira,
>>
>> It's not clear what do you mean in "results themselves", perhaps you mean
>> SolrDocuments ?
>>
>> public abstract class ResultContext {
>> ..
>> public Iterator<SolrDocument> getProcessedDocuments() {
>> return new DocsStreamer(this);
>> }
>>
>> On Fri, May 27, 2016 at 4:15 PM, Upayavira <uv...@odoko.co.uk> wrote:
>>
>> > Yes, I've seen that. I can see the getDocList() method will presumably
>> > give me the results themselves, but I need the full response so I can
>> > get the highlighting details, but I can't see them anywhere.
>> >
>> > On Thu, 26 May 2016, at 09:39 PM, Mikhail Khludnev wrote:
>> > > public abstract class ResultContext {
>> > >
>> > > /// here are all results
>> > > public abstract DocList getDocList();
>> > >
>> > > public abstract ReturnFields getReturnFields();
>> > >
>> > > public abstract SolrIndexSearcher getSearcher();
>> > >
>> > > public abstract Query getQuery();
>> > >
>> > > public abstract SolrQueryRequest getRequest();
>> > >
>> > > On Thu, May 26, 2016 at 11:25 PM, Upayavira <uv...@odoko.co.uk> wrote:
>> > >
>> > > > Hi Mikhail,
>> > > >
>> > > > Is there really? If I look at ResultContext, I see it is an abstract
>> > > > class, completed by BasicResultContext. I don't see any context method
>> > > > there. I can see a getContext() on SolrQueryRequest which just returns
>> > a
>> > > > hashmap. Will I find the response in there? Is that what you are
>> > > > suggesting?
>> > > >
>> > > > Upayavira
>> > > >
>> > > > On Thu, 26 May 2016, at 06:28 PM, Mikhail Khludnev wrote:
>> > > > > Hello,
>> > > > >
>> > > > > There is a protected ResultContext field named context.
>> > > > >
>> > > > > On Thu, May 26, 2016 at 5:31 PM, Upayavira <uv...@odoko.co.uk> wrote:
>> > > > >
>> > > > > > Looking at the code for a sample DocTransformer, it seems that a
>> > > > > > DocTransformer only has access to the document itself, not to the
>> > whole
>> > > > > > results. Because of this, it isn't possible to use a
>> > DocTransformer to
>> > > > > > merge, for example, the highlighting results into the main
>> > document.
>> > > > > >
>> > > > > > Am I missing something?
>> > > > > >
>> > > > > > Upayavira
>> > > > > >
>> > > > >
>> > > > >
>> > > > >
>> > > > > --
>> > > > > Sincerely yours
>> > > > > Mikhail Khludnev
>> > > > > Principal Engineer,
>> > > > > Grid Dynamics
>> > > > >
>> > > > > <http://www.griddynamics.com>
>> > > > > <mk...@griddynamics.com>
>> > > >
>> > >
>> > >
>> > >
>> > > --
>> > > Sincerely yours
>> > > Mikhail Khludnev
>> > > Principal Engineer,
>> > > Grid Dynamics
>> > >
>> > > <http://www.griddynamics.com>
>> > > <mk...@griddynamics.com>
>> >
>>
>>
>>
>> --
>> Sincerely yours
>> Mikhail Khludnev
>> Principal Engineer,
>> Grid Dynamics
>>
>> <http://www.griddynamics.com>
>> <mk...@griddynamics.com>
Re: Can a DocTransformer access the whole results tree?
Posted by Upayavira <uv...@odoko.co.uk>.
:-)
On Sat, 4 Jun 2016, at 06:50 PM, Mikhail Khludnev wrote:
> I'm sorry for thinking sooo slow.
>
> On Sat, Jun 4, 2016 at 7:19 PM, Upayavira <uv...@odoko.co.uk> wrote:
>
> > Ahhh, seen it now in your SubQueryAugmenterFactory, via the threadLocal.
> > Somewhat scary code, but I think I can work with it!
> >
> > Thanks!
> >
> > Upayavira
> >
> > On Sat, 4 Jun 2016, at 10:30 AM, Mikhail Khludnev wrote:
> > > Had you check
> > >
> > https://lucene.apache.org/solr/6_0_0/solr-core/org/apache/solr/request/SolrRequestInfo.html#getRsp--
> > > ?
> > > 27 мая 2016 г. 16:55 пользователь "Upayavira" <uv...@odoko.co.uk> написал:
> > >
> > > > In a JSON response, we get this:
> > > >
> > > > {
> > > > "responseHeader": {...},
> > > > "response": { "docs": [...] },
> > > > "highlighting": {...}
> > > > ...
> > > > }
> > > >
> > > > I'm assuming that the getProcessedDocuments call would give me the
> > docs:
> > > > {} element, whereas I'm after the whole response so I can retrieve the
> > > > "highlighting" element.
> > > >
> > > > Make sense?
> > > >
> > > > On Fri, 27 May 2016, at 02:45 PM, Mikhail Khludnev wrote:
> > > > > Upayavira,
> > > > >
> > > > > It's not clear what do you mean in "results themselves", perhaps you
> > mean
> > > > > SolrDocuments ?
> > > > >
> > > > > public abstract class ResultContext {
> > > > > ..
> > > > > public Iterator<SolrDocument> getProcessedDocuments() {
> > > > > return new DocsStreamer(this);
> > > > > }
> > > > >
> > > > > On Fri, May 27, 2016 at 4:15 PM, Upayavira <uv...@odoko.co.uk> wrote:
> > > > >
> > > > > > Yes, I've seen that. I can see the getDocList() method will
> > presumably
> > > > > > give me the results themselves, but I need the full response so I
> > can
> > > > > > get the highlighting details, but I can't see them anywhere.
> > > > > >
> > > > > > On Thu, 26 May 2016, at 09:39 PM, Mikhail Khludnev wrote:
> > > > > > > public abstract class ResultContext {
> > > > > > >
> > > > > > > /// here are all results
> > > > > > > public abstract DocList getDocList();
> > > > > > >
> > > > > > > public abstract ReturnFields getReturnFields();
> > > > > > >
> > > > > > > public abstract SolrIndexSearcher getSearcher();
> > > > > > >
> > > > > > > public abstract Query getQuery();
> > > > > > >
> > > > > > > public abstract SolrQueryRequest getRequest();
> > > > > > >
> > > > > > > On Thu, May 26, 2016 at 11:25 PM, Upayavira <uv...@odoko.co.uk>
> > wrote:
> > > > > > >
> > > > > > > > Hi Mikhail,
> > > > > > > >
> > > > > > > > Is there really? If I look at ResultContext, I see it is an
> > > > abstract
> > > > > > > > class, completed by BasicResultContext. I don't see any context
> > > > method
> > > > > > > > there. I can see a getContext() on SolrQueryRequest which just
> > > > returns
> > > > > > a
> > > > > > > > hashmap. Will I find the response in there? Is that what you
> > are
> > > > > > > > suggesting?
> > > > > > > >
> > > > > > > > Upayavira
> > > > > > > >
> > > > > > > > On Thu, 26 May 2016, at 06:28 PM, Mikhail Khludnev wrote:
> > > > > > > > > Hello,
> > > > > > > > >
> > > > > > > > > There is a protected ResultContext field named context.
> > > > > > > > >
> > > > > > > > > On Thu, May 26, 2016 at 5:31 PM, Upayavira <uv...@odoko.co.uk>
> > > > wrote:
> > > > > > > > >
> > > > > > > > > > Looking at the code for a sample DocTransformer, it seems
> > that
> > > > a
> > > > > > > > > > DocTransformer only has access to the document itself, not
> > to
> > > > the
> > > > > > whole
> > > > > > > > > > results. Because of this, it isn't possible to use a
> > > > > > DocTransformer to
> > > > > > > > > > merge, for example, the highlighting results into the main
> > > > > > document.
> > > > > > > > > >
> > > > > > > > > > Am I missing something?
> > > > > > > > > >
> > > > > > > > > > Upayavira
> > > > > > > > > >
> > > > > > > > >
> > > > > > > > >
> > > > > > > > >
> > > > > > > > > --
> > > > > > > > > Sincerely yours
> > > > > > > > > Mikhail Khludnev
> > > > > > > > > Principal Engineer,
> > > > > > > > > Grid Dynamics
> > > > > > > > >
> > > > > > > > > <http://www.griddynamics.com>
> > > > > > > > > <mk...@griddynamics.com>
> > > > > > > >
> > > > > > >
> > > > > > >
> > > > > > >
> > > > > > > --
> > > > > > > Sincerely yours
> > > > > > > Mikhail Khludnev
> > > > > > > Principal Engineer,
> > > > > > > Grid Dynamics
> > > > > > >
> > > > > > > <http://www.griddynamics.com>
> > > > > > > <mk...@griddynamics.com>
> > > > > >
> > > > >
> > > > >
> > > > >
> > > > > --
> > > > > Sincerely yours
> > > > > Mikhail Khludnev
> > > > > Principal Engineer,
> > > > > Grid Dynamics
> > > > >
> > > > > <http://www.griddynamics.com>
> > > > > <mk...@griddynamics.com>
> > > >
> >
>
>
>
> --
> Sincerely yours
> Mikhail Khludnev
> Principal Engineer,
> Grid Dynamics
>
> <http://www.griddynamics.com>
> <mk...@griddynamics.com>
Re: Can a DocTransformer access the whole results tree?
Posted by Mikhail Khludnev <mk...@griddynamics.com>.
I'm sorry for thinking sooo slow.
On Sat, Jun 4, 2016 at 7:19 PM, Upayavira <uv...@odoko.co.uk> wrote:
> Ahhh, seen it now in your SubQueryAugmenterFactory, via the threadLocal.
> Somewhat scary code, but I think I can work with it!
>
> Thanks!
>
> Upayavira
>
> On Sat, 4 Jun 2016, at 10:30 AM, Mikhail Khludnev wrote:
> > Had you check
> >
> https://lucene.apache.org/solr/6_0_0/solr-core/org/apache/solr/request/SolrRequestInfo.html#getRsp--
> > ?
> > 27 мая 2016 г. 16:55 пользователь "Upayavira" <uv...@odoko.co.uk> написал:
> >
> > > In a JSON response, we get this:
> > >
> > > {
> > > "responseHeader": {...},
> > > "response": { "docs": [...] },
> > > "highlighting": {...}
> > > ...
> > > }
> > >
> > > I'm assuming that the getProcessedDocuments call would give me the
> docs:
> > > {} element, whereas I'm after the whole response so I can retrieve the
> > > "highlighting" element.
> > >
> > > Make sense?
> > >
> > > On Fri, 27 May 2016, at 02:45 PM, Mikhail Khludnev wrote:
> > > > Upayavira,
> > > >
> > > > It's not clear what do you mean in "results themselves", perhaps you
> mean
> > > > SolrDocuments ?
> > > >
> > > > public abstract class ResultContext {
> > > > ..
> > > > public Iterator<SolrDocument> getProcessedDocuments() {
> > > > return new DocsStreamer(this);
> > > > }
> > > >
> > > > On Fri, May 27, 2016 at 4:15 PM, Upayavira <uv...@odoko.co.uk> wrote:
> > > >
> > > > > Yes, I've seen that. I can see the getDocList() method will
> presumably
> > > > > give me the results themselves, but I need the full response so I
> can
> > > > > get the highlighting details, but I can't see them anywhere.
> > > > >
> > > > > On Thu, 26 May 2016, at 09:39 PM, Mikhail Khludnev wrote:
> > > > > > public abstract class ResultContext {
> > > > > >
> > > > > > /// here are all results
> > > > > > public abstract DocList getDocList();
> > > > > >
> > > > > > public abstract ReturnFields getReturnFields();
> > > > > >
> > > > > > public abstract SolrIndexSearcher getSearcher();
> > > > > >
> > > > > > public abstract Query getQuery();
> > > > > >
> > > > > > public abstract SolrQueryRequest getRequest();
> > > > > >
> > > > > > On Thu, May 26, 2016 at 11:25 PM, Upayavira <uv...@odoko.co.uk>
> wrote:
> > > > > >
> > > > > > > Hi Mikhail,
> > > > > > >
> > > > > > > Is there really? If I look at ResultContext, I see it is an
> > > abstract
> > > > > > > class, completed by BasicResultContext. I don't see any context
> > > method
> > > > > > > there. I can see a getContext() on SolrQueryRequest which just
> > > returns
> > > > > a
> > > > > > > hashmap. Will I find the response in there? Is that what you
> are
> > > > > > > suggesting?
> > > > > > >
> > > > > > > Upayavira
> > > > > > >
> > > > > > > On Thu, 26 May 2016, at 06:28 PM, Mikhail Khludnev wrote:
> > > > > > > > Hello,
> > > > > > > >
> > > > > > > > There is a protected ResultContext field named context.
> > > > > > > >
> > > > > > > > On Thu, May 26, 2016 at 5:31 PM, Upayavira <uv...@odoko.co.uk>
> > > wrote:
> > > > > > > >
> > > > > > > > > Looking at the code for a sample DocTransformer, it seems
> that
> > > a
> > > > > > > > > DocTransformer only has access to the document itself, not
> to
> > > the
> > > > > whole
> > > > > > > > > results. Because of this, it isn't possible to use a
> > > > > DocTransformer to
> > > > > > > > > merge, for example, the highlighting results into the main
> > > > > document.
> > > > > > > > >
> > > > > > > > > Am I missing something?
> > > > > > > > >
> > > > > > > > > Upayavira
> > > > > > > > >
> > > > > > > >
> > > > > > > >
> > > > > > > >
> > > > > > > > --
> > > > > > > > Sincerely yours
> > > > > > > > Mikhail Khludnev
> > > > > > > > Principal Engineer,
> > > > > > > > Grid Dynamics
> > > > > > > >
> > > > > > > > <http://www.griddynamics.com>
> > > > > > > > <mk...@griddynamics.com>
> > > > > > >
> > > > > >
> > > > > >
> > > > > >
> > > > > > --
> > > > > > Sincerely yours
> > > > > > Mikhail Khludnev
> > > > > > Principal Engineer,
> > > > > > Grid Dynamics
> > > > > >
> > > > > > <http://www.griddynamics.com>
> > > > > > <mk...@griddynamics.com>
> > > > >
> > > >
> > > >
> > > >
> > > > --
> > > > Sincerely yours
> > > > Mikhail Khludnev
> > > > Principal Engineer,
> > > > Grid Dynamics
> > > >
> > > > <http://www.griddynamics.com>
> > > > <mk...@griddynamics.com>
> > >
>
--
Sincerely yours
Mikhail Khludnev
Principal Engineer,
Grid Dynamics
<http://www.griddynamics.com>
<mk...@griddynamics.com>
Re: Can a DocTransformer access the whole results tree?
Posted by Upayavira <uv...@odoko.co.uk>.
Ahhh, seen it now in your SubQueryAugmenterFactory, via the threadLocal.
Somewhat scary code, but I think I can work with it!
Thanks!
Upayavira
On Sat, 4 Jun 2016, at 10:30 AM, Mikhail Khludnev wrote:
> Had you check
> https://lucene.apache.org/solr/6_0_0/solr-core/org/apache/solr/request/SolrRequestInfo.html#getRsp--
> ?
> 27 мая 2016 г. 16:55 пользователь "Upayavira" <uv...@odoko.co.uk> написал:
>
> > In a JSON response, we get this:
> >
> > {
> > "responseHeader": {...},
> > "response": { "docs": [...] },
> > "highlighting": {...}
> > ...
> > }
> >
> > I'm assuming that the getProcessedDocuments call would give me the docs:
> > {} element, whereas I'm after the whole response so I can retrieve the
> > "highlighting" element.
> >
> > Make sense?
> >
> > On Fri, 27 May 2016, at 02:45 PM, Mikhail Khludnev wrote:
> > > Upayavira,
> > >
> > > It's not clear what do you mean in "results themselves", perhaps you mean
> > > SolrDocuments ?
> > >
> > > public abstract class ResultContext {
> > > ..
> > > public Iterator<SolrDocument> getProcessedDocuments() {
> > > return new DocsStreamer(this);
> > > }
> > >
> > > On Fri, May 27, 2016 at 4:15 PM, Upayavira <uv...@odoko.co.uk> wrote:
> > >
> > > > Yes, I've seen that. I can see the getDocList() method will presumably
> > > > give me the results themselves, but I need the full response so I can
> > > > get the highlighting details, but I can't see them anywhere.
> > > >
> > > > On Thu, 26 May 2016, at 09:39 PM, Mikhail Khludnev wrote:
> > > > > public abstract class ResultContext {
> > > > >
> > > > > /// here are all results
> > > > > public abstract DocList getDocList();
> > > > >
> > > > > public abstract ReturnFields getReturnFields();
> > > > >
> > > > > public abstract SolrIndexSearcher getSearcher();
> > > > >
> > > > > public abstract Query getQuery();
> > > > >
> > > > > public abstract SolrQueryRequest getRequest();
> > > > >
> > > > > On Thu, May 26, 2016 at 11:25 PM, Upayavira <uv...@odoko.co.uk> wrote:
> > > > >
> > > > > > Hi Mikhail,
> > > > > >
> > > > > > Is there really? If I look at ResultContext, I see it is an
> > abstract
> > > > > > class, completed by BasicResultContext. I don't see any context
> > method
> > > > > > there. I can see a getContext() on SolrQueryRequest which just
> > returns
> > > > a
> > > > > > hashmap. Will I find the response in there? Is that what you are
> > > > > > suggesting?
> > > > > >
> > > > > > Upayavira
> > > > > >
> > > > > > On Thu, 26 May 2016, at 06:28 PM, Mikhail Khludnev wrote:
> > > > > > > Hello,
> > > > > > >
> > > > > > > There is a protected ResultContext field named context.
> > > > > > >
> > > > > > > On Thu, May 26, 2016 at 5:31 PM, Upayavira <uv...@odoko.co.uk>
> > wrote:
> > > > > > >
> > > > > > > > Looking at the code for a sample DocTransformer, it seems that
> > a
> > > > > > > > DocTransformer only has access to the document itself, not to
> > the
> > > > whole
> > > > > > > > results. Because of this, it isn't possible to use a
> > > > DocTransformer to
> > > > > > > > merge, for example, the highlighting results into the main
> > > > document.
> > > > > > > >
> > > > > > > > Am I missing something?
> > > > > > > >
> > > > > > > > Upayavira
> > > > > > > >
> > > > > > >
> > > > > > >
> > > > > > >
> > > > > > > --
> > > > > > > Sincerely yours
> > > > > > > Mikhail Khludnev
> > > > > > > Principal Engineer,
> > > > > > > Grid Dynamics
> > > > > > >
> > > > > > > <http://www.griddynamics.com>
> > > > > > > <mk...@griddynamics.com>
> > > > > >
> > > > >
> > > > >
> > > > >
> > > > > --
> > > > > Sincerely yours
> > > > > Mikhail Khludnev
> > > > > Principal Engineer,
> > > > > Grid Dynamics
> > > > >
> > > > > <http://www.griddynamics.com>
> > > > > <mk...@griddynamics.com>
> > > >
> > >
> > >
> > >
> > > --
> > > Sincerely yours
> > > Mikhail Khludnev
> > > Principal Engineer,
> > > Grid Dynamics
> > >
> > > <http://www.griddynamics.com>
> > > <mk...@griddynamics.com>
> >
Re: Can a DocTransformer access the whole results tree?
Posted by Mikhail Khludnev <mk...@griddynamics.com>.
Had you check
https://lucene.apache.org/solr/6_0_0/solr-core/org/apache/solr/request/SolrRequestInfo.html#getRsp--
?
27 мая 2016 г. 16:55 пользователь "Upayavira" <uv...@odoko.co.uk> написал:
> In a JSON response, we get this:
>
> {
> "responseHeader": {...},
> "response": { "docs": [...] },
> "highlighting": {...}
> ...
> }
>
> I'm assuming that the getProcessedDocuments call would give me the docs:
> {} element, whereas I'm after the whole response so I can retrieve the
> "highlighting" element.
>
> Make sense?
>
> On Fri, 27 May 2016, at 02:45 PM, Mikhail Khludnev wrote:
> > Upayavira,
> >
> > It's not clear what do you mean in "results themselves", perhaps you mean
> > SolrDocuments ?
> >
> > public abstract class ResultContext {
> > ..
> > public Iterator<SolrDocument> getProcessedDocuments() {
> > return new DocsStreamer(this);
> > }
> >
> > On Fri, May 27, 2016 at 4:15 PM, Upayavira <uv...@odoko.co.uk> wrote:
> >
> > > Yes, I've seen that. I can see the getDocList() method will presumably
> > > give me the results themselves, but I need the full response so I can
> > > get the highlighting details, but I can't see them anywhere.
> > >
> > > On Thu, 26 May 2016, at 09:39 PM, Mikhail Khludnev wrote:
> > > > public abstract class ResultContext {
> > > >
> > > > /// here are all results
> > > > public abstract DocList getDocList();
> > > >
> > > > public abstract ReturnFields getReturnFields();
> > > >
> > > > public abstract SolrIndexSearcher getSearcher();
> > > >
> > > > public abstract Query getQuery();
> > > >
> > > > public abstract SolrQueryRequest getRequest();
> > > >
> > > > On Thu, May 26, 2016 at 11:25 PM, Upayavira <uv...@odoko.co.uk> wrote:
> > > >
> > > > > Hi Mikhail,
> > > > >
> > > > > Is there really? If I look at ResultContext, I see it is an
> abstract
> > > > > class, completed by BasicResultContext. I don't see any context
> method
> > > > > there. I can see a getContext() on SolrQueryRequest which just
> returns
> > > a
> > > > > hashmap. Will I find the response in there? Is that what you are
> > > > > suggesting?
> > > > >
> > > > > Upayavira
> > > > >
> > > > > On Thu, 26 May 2016, at 06:28 PM, Mikhail Khludnev wrote:
> > > > > > Hello,
> > > > > >
> > > > > > There is a protected ResultContext field named context.
> > > > > >
> > > > > > On Thu, May 26, 2016 at 5:31 PM, Upayavira <uv...@odoko.co.uk>
> wrote:
> > > > > >
> > > > > > > Looking at the code for a sample DocTransformer, it seems that
> a
> > > > > > > DocTransformer only has access to the document itself, not to
> the
> > > whole
> > > > > > > results. Because of this, it isn't possible to use a
> > > DocTransformer to
> > > > > > > merge, for example, the highlighting results into the main
> > > document.
> > > > > > >
> > > > > > > Am I missing something?
> > > > > > >
> > > > > > > Upayavira
> > > > > > >
> > > > > >
> > > > > >
> > > > > >
> > > > > > --
> > > > > > Sincerely yours
> > > > > > Mikhail Khludnev
> > > > > > Principal Engineer,
> > > > > > Grid Dynamics
> > > > > >
> > > > > > <http://www.griddynamics.com>
> > > > > > <mk...@griddynamics.com>
> > > > >
> > > >
> > > >
> > > >
> > > > --
> > > > Sincerely yours
> > > > Mikhail Khludnev
> > > > Principal Engineer,
> > > > Grid Dynamics
> > > >
> > > > <http://www.griddynamics.com>
> > > > <mk...@griddynamics.com>
> > >
> >
> >
> >
> > --
> > Sincerely yours
> > Mikhail Khludnev
> > Principal Engineer,
> > Grid Dynamics
> >
> > <http://www.griddynamics.com>
> > <mk...@griddynamics.com>
>
Re: Can a DocTransformer access the whole results tree?
Posted by Upayavira <uv...@odoko.co.uk>.
In a JSON response, we get this:
{
"responseHeader": {...},
"response": { "docs": [...] },
"highlighting": {...}
...
}
I'm assuming that the getProcessedDocuments call would give me the docs:
{} element, whereas I'm after the whole response so I can retrieve the
"highlighting" element.
Make sense?
On Fri, 27 May 2016, at 02:45 PM, Mikhail Khludnev wrote:
> Upayavira,
>
> It's not clear what do you mean in "results themselves", perhaps you mean
> SolrDocuments ?
>
> public abstract class ResultContext {
> ..
> public Iterator<SolrDocument> getProcessedDocuments() {
> return new DocsStreamer(this);
> }
>
> On Fri, May 27, 2016 at 4:15 PM, Upayavira <uv...@odoko.co.uk> wrote:
>
> > Yes, I've seen that. I can see the getDocList() method will presumably
> > give me the results themselves, but I need the full response so I can
> > get the highlighting details, but I can't see them anywhere.
> >
> > On Thu, 26 May 2016, at 09:39 PM, Mikhail Khludnev wrote:
> > > public abstract class ResultContext {
> > >
> > > /// here are all results
> > > public abstract DocList getDocList();
> > >
> > > public abstract ReturnFields getReturnFields();
> > >
> > > public abstract SolrIndexSearcher getSearcher();
> > >
> > > public abstract Query getQuery();
> > >
> > > public abstract SolrQueryRequest getRequest();
> > >
> > > On Thu, May 26, 2016 at 11:25 PM, Upayavira <uv...@odoko.co.uk> wrote:
> > >
> > > > Hi Mikhail,
> > > >
> > > > Is there really? If I look at ResultContext, I see it is an abstract
> > > > class, completed by BasicResultContext. I don't see any context method
> > > > there. I can see a getContext() on SolrQueryRequest which just returns
> > a
> > > > hashmap. Will I find the response in there? Is that what you are
> > > > suggesting?
> > > >
> > > > Upayavira
> > > >
> > > > On Thu, 26 May 2016, at 06:28 PM, Mikhail Khludnev wrote:
> > > > > Hello,
> > > > >
> > > > > There is a protected ResultContext field named context.
> > > > >
> > > > > On Thu, May 26, 2016 at 5:31 PM, Upayavira <uv...@odoko.co.uk> wrote:
> > > > >
> > > > > > Looking at the code for a sample DocTransformer, it seems that a
> > > > > > DocTransformer only has access to the document itself, not to the
> > whole
> > > > > > results. Because of this, it isn't possible to use a
> > DocTransformer to
> > > > > > merge, for example, the highlighting results into the main
> > document.
> > > > > >
> > > > > > Am I missing something?
> > > > > >
> > > > > > Upayavira
> > > > > >
> > > > >
> > > > >
> > > > >
> > > > > --
> > > > > Sincerely yours
> > > > > Mikhail Khludnev
> > > > > Principal Engineer,
> > > > > Grid Dynamics
> > > > >
> > > > > <http://www.griddynamics.com>
> > > > > <mk...@griddynamics.com>
> > > >
> > >
> > >
> > >
> > > --
> > > Sincerely yours
> > > Mikhail Khludnev
> > > Principal Engineer,
> > > Grid Dynamics
> > >
> > > <http://www.griddynamics.com>
> > > <mk...@griddynamics.com>
> >
>
>
>
> --
> Sincerely yours
> Mikhail Khludnev
> Principal Engineer,
> Grid Dynamics
>
> <http://www.griddynamics.com>
> <mk...@griddynamics.com>
Re: Can a DocTransformer access the whole results tree?
Posted by Mikhail Khludnev <mk...@griddynamics.com>.
Upayavira,
It's not clear what do you mean in "results themselves", perhaps you mean
SolrDocuments ?
public abstract class ResultContext {
..
public Iterator<SolrDocument> getProcessedDocuments() {
return new DocsStreamer(this);
}
On Fri, May 27, 2016 at 4:15 PM, Upayavira <uv...@odoko.co.uk> wrote:
> Yes, I've seen that. I can see the getDocList() method will presumably
> give me the results themselves, but I need the full response so I can
> get the highlighting details, but I can't see them anywhere.
>
> On Thu, 26 May 2016, at 09:39 PM, Mikhail Khludnev wrote:
> > public abstract class ResultContext {
> >
> > /// here are all results
> > public abstract DocList getDocList();
> >
> > public abstract ReturnFields getReturnFields();
> >
> > public abstract SolrIndexSearcher getSearcher();
> >
> > public abstract Query getQuery();
> >
> > public abstract SolrQueryRequest getRequest();
> >
> > On Thu, May 26, 2016 at 11:25 PM, Upayavira <uv...@odoko.co.uk> wrote:
> >
> > > Hi Mikhail,
> > >
> > > Is there really? If I look at ResultContext, I see it is an abstract
> > > class, completed by BasicResultContext. I don't see any context method
> > > there. I can see a getContext() on SolrQueryRequest which just returns
> a
> > > hashmap. Will I find the response in there? Is that what you are
> > > suggesting?
> > >
> > > Upayavira
> > >
> > > On Thu, 26 May 2016, at 06:28 PM, Mikhail Khludnev wrote:
> > > > Hello,
> > > >
> > > > There is a protected ResultContext field named context.
> > > >
> > > > On Thu, May 26, 2016 at 5:31 PM, Upayavira <uv...@odoko.co.uk> wrote:
> > > >
> > > > > Looking at the code for a sample DocTransformer, it seems that a
> > > > > DocTransformer only has access to the document itself, not to the
> whole
> > > > > results. Because of this, it isn't possible to use a
> DocTransformer to
> > > > > merge, for example, the highlighting results into the main
> document.
> > > > >
> > > > > Am I missing something?
> > > > >
> > > > > Upayavira
> > > > >
> > > >
> > > >
> > > >
> > > > --
> > > > Sincerely yours
> > > > Mikhail Khludnev
> > > > Principal Engineer,
> > > > Grid Dynamics
> > > >
> > > > <http://www.griddynamics.com>
> > > > <mk...@griddynamics.com>
> > >
> >
> >
> >
> > --
> > Sincerely yours
> > Mikhail Khludnev
> > Principal Engineer,
> > Grid Dynamics
> >
> > <http://www.griddynamics.com>
> > <mk...@griddynamics.com>
>
--
Sincerely yours
Mikhail Khludnev
Principal Engineer,
Grid Dynamics
<http://www.griddynamics.com>
<mk...@griddynamics.com>
Re: Can a DocTransformer access the whole results tree?
Posted by Upayavira <uv...@odoko.co.uk>.
Yes, I've seen that. I can see the getDocList() method will presumably
give me the results themselves, but I need the full response so I can
get the highlighting details, but I can't see them anywhere.
On Thu, 26 May 2016, at 09:39 PM, Mikhail Khludnev wrote:
> public abstract class ResultContext {
>
> /// here are all results
> public abstract DocList getDocList();
>
> public abstract ReturnFields getReturnFields();
>
> public abstract SolrIndexSearcher getSearcher();
>
> public abstract Query getQuery();
>
> public abstract SolrQueryRequest getRequest();
>
> On Thu, May 26, 2016 at 11:25 PM, Upayavira <uv...@odoko.co.uk> wrote:
>
> > Hi Mikhail,
> >
> > Is there really? If I look at ResultContext, I see it is an abstract
> > class, completed by BasicResultContext. I don't see any context method
> > there. I can see a getContext() on SolrQueryRequest which just returns a
> > hashmap. Will I find the response in there? Is that what you are
> > suggesting?
> >
> > Upayavira
> >
> > On Thu, 26 May 2016, at 06:28 PM, Mikhail Khludnev wrote:
> > > Hello,
> > >
> > > There is a protected ResultContext field named context.
> > >
> > > On Thu, May 26, 2016 at 5:31 PM, Upayavira <uv...@odoko.co.uk> wrote:
> > >
> > > > Looking at the code for a sample DocTransformer, it seems that a
> > > > DocTransformer only has access to the document itself, not to the whole
> > > > results. Because of this, it isn't possible to use a DocTransformer to
> > > > merge, for example, the highlighting results into the main document.
> > > >
> > > > Am I missing something?
> > > >
> > > > Upayavira
> > > >
> > >
> > >
> > >
> > > --
> > > Sincerely yours
> > > Mikhail Khludnev
> > > Principal Engineer,
> > > Grid Dynamics
> > >
> > > <http://www.griddynamics.com>
> > > <mk...@griddynamics.com>
> >
>
>
>
> --
> Sincerely yours
> Mikhail Khludnev
> Principal Engineer,
> Grid Dynamics
>
> <http://www.griddynamics.com>
> <mk...@griddynamics.com>
Re: Can a DocTransformer access the whole results tree?
Posted by Mikhail Khludnev <mk...@griddynamics.com>.
public abstract class ResultContext {
/// here are all results
public abstract DocList getDocList();
public abstract ReturnFields getReturnFields();
public abstract SolrIndexSearcher getSearcher();
public abstract Query getQuery();
public abstract SolrQueryRequest getRequest();
On Thu, May 26, 2016 at 11:25 PM, Upayavira <uv...@odoko.co.uk> wrote:
> Hi Mikhail,
>
> Is there really? If I look at ResultContext, I see it is an abstract
> class, completed by BasicResultContext. I don't see any context method
> there. I can see a getContext() on SolrQueryRequest which just returns a
> hashmap. Will I find the response in there? Is that what you are
> suggesting?
>
> Upayavira
>
> On Thu, 26 May 2016, at 06:28 PM, Mikhail Khludnev wrote:
> > Hello,
> >
> > There is a protected ResultContext field named context.
> >
> > On Thu, May 26, 2016 at 5:31 PM, Upayavira <uv...@odoko.co.uk> wrote:
> >
> > > Looking at the code for a sample DocTransformer, it seems that a
> > > DocTransformer only has access to the document itself, not to the whole
> > > results. Because of this, it isn't possible to use a DocTransformer to
> > > merge, for example, the highlighting results into the main document.
> > >
> > > Am I missing something?
> > >
> > > Upayavira
> > >
> >
> >
> >
> > --
> > Sincerely yours
> > Mikhail Khludnev
> > Principal Engineer,
> > Grid Dynamics
> >
> > <http://www.griddynamics.com>
> > <mk...@griddynamics.com>
>
--
Sincerely yours
Mikhail Khludnev
Principal Engineer,
Grid Dynamics
<http://www.griddynamics.com>
<mk...@griddynamics.com>
Re: Can a DocTransformer access the whole results tree?
Posted by Upayavira <uv...@odoko.co.uk>.
Hi Mikhail,
Is there really? If I look at ResultContext, I see it is an abstract
class, completed by BasicResultContext. I don't see any context method
there. I can see a getContext() on SolrQueryRequest which just returns a
hashmap. Will I find the response in there? Is that what you are
suggesting?
Upayavira
On Thu, 26 May 2016, at 06:28 PM, Mikhail Khludnev wrote:
> Hello,
>
> There is a protected ResultContext field named context.
>
> On Thu, May 26, 2016 at 5:31 PM, Upayavira <uv...@odoko.co.uk> wrote:
>
> > Looking at the code for a sample DocTransformer, it seems that a
> > DocTransformer only has access to the document itself, not to the whole
> > results. Because of this, it isn't possible to use a DocTransformer to
> > merge, for example, the highlighting results into the main document.
> >
> > Am I missing something?
> >
> > Upayavira
> >
>
>
>
> --
> Sincerely yours
> Mikhail Khludnev
> Principal Engineer,
> Grid Dynamics
>
> <http://www.griddynamics.com>
> <mk...@griddynamics.com>
Re: Can a DocTransformer access the whole results tree?
Posted by Mikhail Khludnev <mk...@griddynamics.com>.
Hello,
There is a protected ResultContext field named context.
On Thu, May 26, 2016 at 5:31 PM, Upayavira <uv...@odoko.co.uk> wrote:
> Looking at the code for a sample DocTransformer, it seems that a
> DocTransformer only has access to the document itself, not to the whole
> results. Because of this, it isn't possible to use a DocTransformer to
> merge, for example, the highlighting results into the main document.
>
> Am I missing something?
>
> Upayavira
>
--
Sincerely yours
Mikhail Khludnev
Principal Engineer,
Grid Dynamics
<http://www.griddynamics.com>
<mk...@griddynamics.com>