Re: Can a DocTransformer access the whole results tree?

2016-06-06 Thread Upayavira
:-)

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  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"  написал:
> > >
> > > > 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 getProcessedDocuments() {
> > > > > return new DocsStreamer(this);
> > > > >   }
> > > > >
> > > > > On Fri, May 27, 2016 at 4:15 PM, Upayavira  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 
> > 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 
> > > > 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
> > > > > > > > >
> > > > > > > > > 
> > > > > > > > > 
> > > > > > > >
> > > > > > >
> > > > > > >
> > > > > > >
> > > > > > > --
> > > > > > > Sincerely yours
> > > > > > > Mikhail Khludnev
> > > > > > > Principal Engineer,
> > > > > > > Grid Dynamics
> > > > > > >
> > > > > > > 
> > > > > > > 
> > > > > >
> > > > >
> > > > >
> > > > >
> > > > > --
> > > > > Sincerely yours
> > > > > Mikhail Khludnev
> > > > > Principal Engineer,
> > > > > Grid Dynamics
> > > > >
> > > > > 
> > > > > 
> > > >
> >
> 
> 
> 
> -- 
> Sincerely yours
> Mikhail Khludnev
> Principal Engineer,
> Grid Dynamics
> 
> 
> 


Re: Can a DocTransformer access the whole results tree?

2016-06-04 Thread Mikhail Khludnev
I'm sorry for thinking sooo slow.

On Sat, Jun 4, 2016 at 7:19 PM, Upayavira  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"  написал:
> >
> > > 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 getProcessedDocuments() {
> > > > return new DocsStreamer(this);
> > > >   }
> > > >
> > > > On Fri, May 27, 2016 at 4:15 PM, Upayavira  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 
> 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 
> > > 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
> > > > > > > >
> > > > > > > > 
> > > > > > > > 
> > > > > > >
> > > > > >
> > > > > >
> > > > > >
> > > > > > --
> > > > > > Sincerely yours
> > > > > > Mikhail Khludnev
> > > > > > Principal Engineer,
> > > > > > Grid Dynamics
> > > > > >
> > > > > > 
> > > > > > 
> > > > >
> > > >
> > > >
> > > >
> > > > --
> > > > Sincerely yours
> > > > Mikhail Khludnev
> > > > Principal Engineer,
> > > > Grid Dynamics
> > > >
> > > > 
> > > > 
> > >
>



-- 
Sincerely yours
Mikhail Khludnev
Principal Engineer,
Grid Dynamics





Re: Can a DocTransformer access the whole results tree?

2016-06-04 Thread Upayavira
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"  написал:
> 
> > 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 getProcessedDocuments() {
> > > return new DocsStreamer(this);
> > >   }
> > >
> > > On Fri, May 27, 2016 at 4:15 PM, Upayavira  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  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 
> > 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
> > > > > > >
> > > > > > > 
> > > > > > > 
> > > > > >
> > > > >
> > > > >
> > > > >
> > > > > --
> > > > > Sincerely yours
> > > > > Mikhail Khludnev
> > > > > Principal Engineer,
> > > > > Grid Dynamics
> > > > >
> > > > > 
> > > > > 
> > > >
> > >
> > >
> > >
> > > --
> > > Sincerely yours
> > > Mikhail Khludnev
> > > Principal Engineer,
> > > Grid Dynamics
> > >
> > > 
> > > 
> >


Re: Can a DocTransformer access the whole results tree?

2016-06-04 Thread Mikhail Khludnev
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"  написал:

> 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 getProcessedDocuments() {
> > return new DocsStreamer(this);
> >   }
> >
> > On Fri, May 27, 2016 at 4:15 PM, Upayavira  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  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 
> 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
> > > > > >
> > > > > > 
> > > > > > 
> > > > >
> > > >
> > > >
> > > >
> > > > --
> > > > Sincerely yours
> > > > Mikhail Khludnev
> > > > Principal Engineer,
> > > > Grid Dynamics
> > > >
> > > > 
> > > > 
> > >
> >
> >
> >
> > --
> > Sincerely yours
> > Mikhail Khludnev
> > Principal Engineer,
> > Grid Dynamics
> >
> > 
> > 
>


Re: Can a DocTransformer access the whole results tree?

2016-05-31 Thread Upayavira
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  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 getProcessedDocuments() {
> >> return new DocsStreamer(this);
> >>   }
> >>
> >> On Fri, May 27, 2016 at 4:15 PM, Upayavira  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  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  
> >> > > > > 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
> >> > > > >
> >> > > > > 
> >> > > > > 
> >> > > >
> >> > >
> >> > >
> >> > >
> >> > > --
> >> > > Sincerely yours
> >> > > Mikhail Khludnev
> >> > > Principal Engineer,
> >> > > Grid Dynamics
> >> > >
> >> > > 
> >> > > 
> >> >
> >>
> >>
> >>
> >> --
> >> Sincerely yours
> >> Mikhail Khludnev
> >> Principal Engineer,
> >> Grid Dynamics
> >>
> >> 
> >> 


Re: Can a DocTransformer access the whole results tree?

2016-05-28 Thread Stefan Matheis
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"  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  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 getProcessedDocuments() {
> >> return new DocsStreamer(this);
> >>   }
> >>
> >> On Fri, May 27, 2016 at 4:15 PM, Upayavira  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  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 
> 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
> >> > > > >
> >> > > > > 
> >> > > > > 
> >> > > >
> >> > >
> >> > >
> >> > >
> >> > > --
> >> > > Sincerely yours
> >> > > Mikhail Khludnev
> >> > > Principal Engineer,
> >> > > Grid Dynamics
> >> > >
> >> > > 
> >> > > 
> >> >
> >>
> >>
> >>
> >> --
> >> Sincerely yours
> >> Mikhail Khludnev
> >> Principal Engineer,
> >> Grid Dynamics
> >>
> >> 
> >> 
>


Re: Can a DocTransformer access the whole results tree?

2016-05-27 Thread Erick Erickson
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  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 getProcessedDocuments() {
>> return new DocsStreamer(this);
>>   }
>>
>> On Fri, May 27, 2016 at 4:15 PM, Upayavira  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  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  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
>> > > > >
>> > > > > 
>> > > > > 
>> > > >
>> > >
>> > >
>> > >
>> > > --
>> > > Sincerely yours
>> > > Mikhail Khludnev
>> > > Principal Engineer,
>> > > Grid Dynamics
>> > >
>> > > 
>> > > 
>> >
>>
>>
>>
>> --
>> Sincerely yours
>> Mikhail Khludnev
>> Principal Engineer,
>> Grid Dynamics
>>
>> 
>> 


Re: Can a DocTransformer access the whole results tree?

2016-05-27 Thread Upayavira
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 getProcessedDocuments() {
> return new DocsStreamer(this);
>   }
> 
> On Fri, May 27, 2016 at 4:15 PM, Upayavira  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  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  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
> > > > >
> > > > > 
> > > > > 
> > > >
> > >
> > >
> > >
> > > --
> > > Sincerely yours
> > > Mikhail Khludnev
> > > Principal Engineer,
> > > Grid Dynamics
> > >
> > > 
> > > 
> >
> 
> 
> 
> -- 
> Sincerely yours
> Mikhail Khludnev
> Principal Engineer,
> Grid Dynamics
> 
> 
> 


Re: Can a DocTransformer access the whole results tree?

2016-05-27 Thread Mikhail Khludnev
Upayavira,

It's not clear what do you mean in "results themselves", perhaps you mean
SolrDocuments ?

public abstract class ResultContext {
 ..
  public Iterator getProcessedDocuments() {
return new DocsStreamer(this);
  }

On Fri, May 27, 2016 at 4:15 PM, Upayavira  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  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  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
> > > >
> > > > 
> > > > 
> > >
> >
> >
> >
> > --
> > Sincerely yours
> > Mikhail Khludnev
> > Principal Engineer,
> > Grid Dynamics
> >
> > 
> > 
>



-- 
Sincerely yours
Mikhail Khludnev
Principal Engineer,
Grid Dynamics





Re: Can a DocTransformer access the whole results tree?

2016-05-27 Thread Upayavira
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  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  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
> > >
> > > 
> > > 
> >
> 
> 
> 
> -- 
> Sincerely yours
> Mikhail Khludnev
> Principal Engineer,
> Grid Dynamics
> 
> 
> 


Re: Can a DocTransformer access the whole results tree?

2016-05-26 Thread Mikhail Khludnev
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  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  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
> >
> > 
> > 
>



-- 
Sincerely yours
Mikhail Khludnev
Principal Engineer,
Grid Dynamics





Re: Can a DocTransformer access the whole results tree?

2016-05-26 Thread Upayavira
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  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
> 
> 
> 


Re: Can a DocTransformer access the whole results tree?

2016-05-26 Thread Mikhail Khludnev
Hello,

There is a protected ResultContext field named context.

On Thu, May 26, 2016 at 5:31 PM, Upayavira  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