modify query response plugin

classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

modify query response plugin

Maria Muslea
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
Reply | Threaded
Open this post in threaded view
|

Re: modify query response plugin

Erik Hatcher-4
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 <[hidden email]> 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
Reply | Threaded
Open this post in threaded view
|

Re: modify query response plugin

Maria Muslea
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 <[hidden email]> 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 <[hidden email]> 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
>
Reply | Threaded
Open this post in threaded view
|

RE: modify query response plugin

Moyer, Brett
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
[hidden email]


-----Original Message-----
From: Maria Muslea <[hidden email]>
Sent: Thursday, August 8, 2019 1:28 PM
To: [hidden email]
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 <[hidden email]> 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 <[hidden email]> 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
*************************************************************************
Reply | Threaded
Open this post in threaded view
|

Re: modify query response plugin

Atita Arora
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 <[hidden email]> 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
> [hidden email]
>
>
> -----Original Message-----
> From: Maria Muslea <[hidden email]>
> Sent: Thursday, August 8, 2019 1:28 PM
> To: [hidden email]
> 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 <[hidden email]>
> 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 <[hidden email]> 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
> *************************************************************************
>
Reply | Threaded
Open this post in threaded view
|

Re: modify query response plugin

Andrea Gazzarini-6
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, <[hidden email]> 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 <[hidden email]> 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
> > [hidden email]
> >
> >
> > -----Original Message-----
> > From: Maria Muslea <[hidden email]>
> > Sent: Thursday, August 8, 2019 1:28 PM
> > To: [hidden email]
> > 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 <[hidden email]>
> > 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 <[hidden email]>
> 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
> > *************************************************************************
> >
>
Reply | Threaded
Open this post in threaded view
|

Re: modify query response plugin

Maria Muslea
In reply to this post by Moyer, Brett
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 <[hidden email]> 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
> [hidden email]
>
>
> -----Original Message-----
> From: Maria Muslea <[hidden email]>
> Sent: Thursday, August 8, 2019 1:28 PM
> To: [hidden email]
> 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 <[hidden email]>
> 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 <[hidden email]> 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
> *************************************************************************
>