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 Maria Muslea <ma...@gmail.com> on 2019/08/06 20:04:59 UTC

modify query response plugin

Hi,

I am trying to implement a plugin that will modify my query response. For
example, I would like to execute a query that will return something like:

{...
"description":"flights at LAX",
"highlight":"airport;11;3"
...}
This is information that I have in my document, so I can return it.

Now, I would like the plugin to intercept the result, do some processing on
it, and return something like:

{...
"description":"flights at LAX",
"highlight":{
       "concept":"airport",
       "description":"flights at <em>LAX</em>"
...}

I looked at some RequestHandler implementations, but I can't find any
sample code that would help me with this. Would this type of plugin be
handled by a RequestHandler? Could you maybe point me to a sample plugin
that does something similar?

I would really appreciate your help.

Thank you,
Maria

Re: modify query response plugin

Posted by Maria Muslea <ma...@gmail.com>.
I am not able to use the highlighter because in my example the text
contains "LAX",
 and the search is on "airport" on a different field than the text field.

I was able to use SearchComponent to add my own highlighting section.

Thank you,
Maria


On Thu, Aug 8, 2019 at 2:20 PM Moyer, Brett <BM...@tiaa.org> wrote:

> Highlight? What about using the Highlighter?
> https://lucene.apache.org/solr/guide/6_6/highlighting.html
>
> Brett Moyer
> Manager, Sr. Technical Lead | TFS Technology
>   Public Production Support
>   Digital Search & Discovery
>
> 8625 Andrew Carnegie Blvd | 4th floor
> Charlotte, NC 28263
> Tel: 704.988.4508
> Fax: 704.988.4907
> bmoyer@tiaa.org
>
>
> -----Original Message-----
> From: Maria Muslea <ma...@gmail.com>
> Sent: Thursday, August 8, 2019 1:28 PM
> To: solr-user@lucene.apache.org
> Subject: Re: modify query response plugin
>
> Thank you for your response. I believe that the Tagger is used for NER,
> which is different than what I am trying to do.
> It is also available only with Solr 7 and I would need this to work with
> version 6.5.0.
>
> I am trying to manipulate the data that I already have in the response,
> and I can't find a good example of a plugin that does something similar, so
> I can see how I can access the response and construct a new one.
>
> Your help is greatly appreciated.
>
> Thank you,
> Maria
>
> On Tue, Aug 6, 2019 at 3:19 PM Erik Hatcher <er...@gmail.com>
> wrote:
>
> > I think you’re looking for the Solr Tagger, described here:
> > https://lucidworks.com/post/solr-tagger-improving-relevancy/
> >
> > > On Aug 6, 2019, at 16:04, Maria Muslea <ma...@gmail.com> wrote:
> > >
> > > Hi,
> > >
> > > I am trying to implement a plugin that will modify my query
> > > response. For example, I would like to execute a query that will
> return something like:
> > >
> > > {...
> > > "description":"flights at LAX",
> > > "highlight":"airport;11;3"
> > > ...}
> > > This is information that I have in my document, so I can return it.
> > >
> > > Now, I would like the plugin to intercept the result, do some
> > > processing
> > on
> > > it, and return something like:
> > >
> > > {...
> > > "description":"flights at LAX",
> > > "highlight":{
> > >       "concept":"airport",
> > >       "description":"flights at <em>LAX</em>"
> > > ...}
> > >
> > > I looked at some RequestHandler implementations, but I can't find
> > > any sample code that would help me with this. Would this type of
> > > plugin be handled by a RequestHandler? Could you maybe point me to a
> > > sample plugin that does something similar?
> > >
> > > I would really appreciate your help.
> > >
> > > Thank you,
> > > Maria
> >
> *************************************************************************
> This e-mail may contain confidential or privileged information.
> If you are not the intended recipient, please notify the sender
> immediately and then delete it.
>
> TIAA
> *************************************************************************
>

Re: modify query response plugin

Posted by Andrea Gazzarini <a....@sease.io>.
I'm not really sure I got what you want to achieve, but after reading

" I am trying to manipulate the data that I already have in the response,
...
I can see how I can access the response and construct a new one."

an option to consider could be a query response writer [1].

Cheers,
Andrea

[1] https://lucene.apache.org/solr/guide/6_6/response-writers.html


On Thu, 8 Aug 2019, 23:34 Atita Arora, <at...@gmail.com> wrote:

> Isn't it resolved by simply adding the desired pre/post tags in highlighter
> request?
>
> On Thu, Aug 8, 2019 at 11:20 PM Moyer, Brett <BM...@tiaa.org> wrote:
>
> > Highlight? What about using the Highlighter?
> > https://lucene.apache.org/solr/guide/6_6/highlighting.html
> >
> > Brett Moyer
> > Manager, Sr. Technical Lead | TFS Technology
> >   Public Production Support
> >   Digital Search & Discovery
> >
> > 8625 Andrew Carnegie Blvd | 4th floor
> > Charlotte, NC 28263
> > Tel: 704.988.4508
> > Fax: 704.988.4907
> > bmoyer@tiaa.org
> >
> >
> > -----Original Message-----
> > From: Maria Muslea <ma...@gmail.com>
> > Sent: Thursday, August 8, 2019 1:28 PM
> > To: solr-user@lucene.apache.org
> > Subject: Re: modify query response plugin
> >
> > Thank you for your response. I believe that the Tagger is used for NER,
> > which is different than what I am trying to do.
> > It is also available only with Solr 7 and I would need this to work with
> > version 6.5.0.
> >
> > I am trying to manipulate the data that I already have in the response,
> > and I can't find a good example of a plugin that does something similar,
> so
> > I can see how I can access the response and construct a new one.
> >
> > Your help is greatly appreciated.
> >
> > Thank you,
> > Maria
> >
> > On Tue, Aug 6, 2019 at 3:19 PM Erik Hatcher <er...@gmail.com>
> > wrote:
> >
> > > I think you’re looking for the Solr Tagger, described here:
> > > https://lucidworks.com/post/solr-tagger-improving-relevancy/
> > >
> > > > On Aug 6, 2019, at 16:04, Maria Muslea <ma...@gmail.com>
> wrote:
> > > >
> > > > Hi,
> > > >
> > > > I am trying to implement a plugin that will modify my query
> > > > response. For example, I would like to execute a query that will
> > return something like:
> > > >
> > > > {...
> > > > "description":"flights at LAX",
> > > > "highlight":"airport;11;3"
> > > > ...}
> > > > This is information that I have in my document, so I can return it.
> > > >
> > > > Now, I would like the plugin to intercept the result, do some
> > > > processing
> > > on
> > > > it, and return something like:
> > > >
> > > > {...
> > > > "description":"flights at LAX",
> > > > "highlight":{
> > > >       "concept":"airport",
> > > >       "description":"flights at <em>LAX</em>"
> > > > ...}
> > > >
> > > > I looked at some RequestHandler implementations, but I can't find
> > > > any sample code that would help me with this. Would this type of
> > > > plugin be handled by a RequestHandler? Could you maybe point me to a
> > > > sample plugin that does something similar?
> > > >
> > > > I would really appreciate your help.
> > > >
> > > > Thank you,
> > > > Maria
> > >
> > *************************************************************************
> > This e-mail may contain confidential or privileged information.
> > If you are not the intended recipient, please notify the sender
> > immediately and then delete it.
> >
> > TIAA
> > *************************************************************************
> >
>

Re: modify query response plugin

Posted by Atita Arora <at...@gmail.com>.
Isn't it resolved by simply adding the desired pre/post tags in highlighter
request?

On Thu, Aug 8, 2019 at 11:20 PM Moyer, Brett <BM...@tiaa.org> wrote:

> Highlight? What about using the Highlighter?
> https://lucene.apache.org/solr/guide/6_6/highlighting.html
>
> Brett Moyer
> Manager, Sr. Technical Lead | TFS Technology
>   Public Production Support
>   Digital Search & Discovery
>
> 8625 Andrew Carnegie Blvd | 4th floor
> Charlotte, NC 28263
> Tel: 704.988.4508
> Fax: 704.988.4907
> bmoyer@tiaa.org
>
>
> -----Original Message-----
> From: Maria Muslea <ma...@gmail.com>
> Sent: Thursday, August 8, 2019 1:28 PM
> To: solr-user@lucene.apache.org
> Subject: Re: modify query response plugin
>
> Thank you for your response. I believe that the Tagger is used for NER,
> which is different than what I am trying to do.
> It is also available only with Solr 7 and I would need this to work with
> version 6.5.0.
>
> I am trying to manipulate the data that I already have in the response,
> and I can't find a good example of a plugin that does something similar, so
> I can see how I can access the response and construct a new one.
>
> Your help is greatly appreciated.
>
> Thank you,
> Maria
>
> On Tue, Aug 6, 2019 at 3:19 PM Erik Hatcher <er...@gmail.com>
> wrote:
>
> > I think you’re looking for the Solr Tagger, described here:
> > https://lucidworks.com/post/solr-tagger-improving-relevancy/
> >
> > > On Aug 6, 2019, at 16:04, Maria Muslea <ma...@gmail.com> wrote:
> > >
> > > Hi,
> > >
> > > I am trying to implement a plugin that will modify my query
> > > response. For example, I would like to execute a query that will
> return something like:
> > >
> > > {...
> > > "description":"flights at LAX",
> > > "highlight":"airport;11;3"
> > > ...}
> > > This is information that I have in my document, so I can return it.
> > >
> > > Now, I would like the plugin to intercept the result, do some
> > > processing
> > on
> > > it, and return something like:
> > >
> > > {...
> > > "description":"flights at LAX",
> > > "highlight":{
> > >       "concept":"airport",
> > >       "description":"flights at <em>LAX</em>"
> > > ...}
> > >
> > > I looked at some RequestHandler implementations, but I can't find
> > > any sample code that would help me with this. Would this type of
> > > plugin be handled by a RequestHandler? Could you maybe point me to a
> > > sample plugin that does something similar?
> > >
> > > I would really appreciate your help.
> > >
> > > Thank you,
> > > Maria
> >
> *************************************************************************
> This e-mail may contain confidential or privileged information.
> If you are not the intended recipient, please notify the sender
> immediately and then delete it.
>
> TIAA
> *************************************************************************
>

RE: modify query response plugin

Posted by "Moyer, Brett" <BM...@tiaa.org>.
Highlight? What about using the Highlighter? https://lucene.apache.org/solr/guide/6_6/highlighting.html

Brett Moyer
Manager, Sr. Technical Lead | TFS Technology
  Public Production Support
  Digital Search & Discovery

8625 Andrew Carnegie Blvd | 4th floor
Charlotte, NC 28263
Tel: 704.988.4508
Fax: 704.988.4907
bmoyer@tiaa.org


-----Original Message-----
From: Maria Muslea <ma...@gmail.com> 
Sent: Thursday, August 8, 2019 1:28 PM
To: solr-user@lucene.apache.org
Subject: Re: modify query response plugin

Thank you for your response. I believe that the Tagger is used for NER, which is different than what I am trying to do.
It is also available only with Solr 7 and I would need this to work with version 6.5.0.

I am trying to manipulate the data that I already have in the response, and I can't find a good example of a plugin that does something similar, so I can see how I can access the response and construct a new one.

Your help is greatly appreciated.

Thank you,
Maria

On Tue, Aug 6, 2019 at 3:19 PM Erik Hatcher <er...@gmail.com> wrote:

> I think you’re looking for the Solr Tagger, described here:
> https://lucidworks.com/post/solr-tagger-improving-relevancy/
>
> > On Aug 6, 2019, at 16:04, Maria Muslea <ma...@gmail.com> wrote:
> >
> > Hi,
> >
> > I am trying to implement a plugin that will modify my query 
> > response. For example, I would like to execute a query that will return something like:
> >
> > {...
> > "description":"flights at LAX",
> > "highlight":"airport;11;3"
> > ...}
> > This is information that I have in my document, so I can return it.
> >
> > Now, I would like the plugin to intercept the result, do some 
> > processing
> on
> > it, and return something like:
> >
> > {...
> > "description":"flights at LAX",
> > "highlight":{
> >       "concept":"airport",
> >       "description":"flights at <em>LAX</em>"
> > ...}
> >
> > I looked at some RequestHandler implementations, but I can't find 
> > any sample code that would help me with this. Would this type of 
> > plugin be handled by a RequestHandler? Could you maybe point me to a 
> > sample plugin that does something similar?
> >
> > I would really appreciate your help.
> >
> > Thank you,
> > Maria
>
*************************************************************************
This e-mail may contain confidential or privileged information.
If you are not the intended recipient, please notify the sender immediately and then delete it.

TIAA
*************************************************************************

Re: modify query response plugin

Posted by Maria Muslea <ma...@gmail.com>.
Thank you for your response. I believe that the Tagger is used for NER,
which is different than what I am trying to do.
It is also available only with Solr 7 and I would need this to work with
version 6.5.0.

I am trying to manipulate the data that I already have in the response, and
I can't find a good example of a plugin that does
something similar, so I can see how I can access the response and construct
a new one.

Your help is greatly appreciated.

Thank you,
Maria

On Tue, Aug 6, 2019 at 3:19 PM Erik Hatcher <er...@gmail.com> wrote:

> I think you’re looking for the Solr Tagger, described here:
> https://lucidworks.com/post/solr-tagger-improving-relevancy/
>
> > On Aug 6, 2019, at 16:04, Maria Muslea <ma...@gmail.com> wrote:
> >
> > Hi,
> >
> > I am trying to implement a plugin that will modify my query response. For
> > example, I would like to execute a query that will return something like:
> >
> > {...
> > "description":"flights at LAX",
> > "highlight":"airport;11;3"
> > ...}
> > This is information that I have in my document, so I can return it.
> >
> > Now, I would like the plugin to intercept the result, do some processing
> on
> > it, and return something like:
> >
> > {...
> > "description":"flights at LAX",
> > "highlight":{
> >       "concept":"airport",
> >       "description":"flights at <em>LAX</em>"
> > ...}
> >
> > I looked at some RequestHandler implementations, but I can't find any
> > sample code that would help me with this. Would this type of plugin be
> > handled by a RequestHandler? Could you maybe point me to a sample plugin
> > that does something similar?
> >
> > I would really appreciate your help.
> >
> > Thank you,
> > Maria
>

Re: modify query response plugin

Posted by Erik Hatcher <er...@gmail.com>.
I think you’re looking for the Solr Tagger, described here: https://lucidworks.com/post/solr-tagger-improving-relevancy/

> On Aug 6, 2019, at 16:04, Maria Muslea <ma...@gmail.com> wrote:
> 
> Hi,
> 
> I am trying to implement a plugin that will modify my query response. For
> example, I would like to execute a query that will return something like:
> 
> {...
> "description":"flights at LAX",
> "highlight":"airport;11;3"
> ...}
> This is information that I have in my document, so I can return it.
> 
> Now, I would like the plugin to intercept the result, do some processing on
> it, and return something like:
> 
> {...
> "description":"flights at LAX",
> "highlight":{
>       "concept":"airport",
>       "description":"flights at <em>LAX</em>"
> ...}
> 
> I looked at some RequestHandler implementations, but I can't find any
> sample code that would help me with this. Would this type of plugin be
> handled by a RequestHandler? Could you maybe point me to a sample plugin
> that does something similar?
> 
> I would really appreciate your help.
> 
> Thank you,
> Maria