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 Alex Wang <aw...@crossview.com> on 2009/03/30 22:31:20 UTC

Hijacking Search Requests

Hi everyone,

We have a web application that queries a Solr server through http. What we would like to do is to customize the Solr server and hijack the search request. If the user search term matches certain rules, then redirect the user to a different page without even performing any search in Solr, if the search term does not match any rules, then perform search as usual.

The question is how this can be achieved with the new SearchComponent architecture.

Any inputs would be appreciated!

Alex

RE: Hijacking Search Requests

Posted by Alex Wang <aw...@crossview.com>.
Thanks Noble Paul for the valuable tip. A servlet filter sounds like a great solution here. 

>-----Original Message-----
>From: Noble Paul നോബിള്‍ नोब्ळ् [mailto:noble.paul@gmail.com]
>Sent: Tuesday, March 31, 2009 1:29 AM
>To: solr-user@lucene.apache.org
>Subject: Re: Hijacking Search Requests
>
>you may write a servlet filter which is applied before the
>SolrDispatchFilter which applies the rules and do the redirect/forward
>
>
>On Tue, Mar 31, 2009 at 2:54 AM, Alex Wang <aw...@crossview.com> wrote:
>> Thanks Grant. Yes, I was trying to persuade our architect to do this from
>the web application itself, but he prefers to centralize this functionality
>on the Solr server rather than having all client applications implement
>their own.
>>
>> Cheers!
>>
>> Alex
>>
>>
>>
>>>-----Original Message-----
>>>From: Grant Ingersoll [mailto:gsingers@apache.org]
>>>Sent: Monday, March 30, 2009 4:49 PM
>>>To: solr-user@lucene.apache.org
>>>Subject: Re: Hijacking Search Requests
>>>
>>>I think this can be done with a load balancer such that you don't even
>>>need to go to Solr, right?  Or, do you mean you want different
>>>"results" from Solr itself?
>>>
>>>On Mar 30, 2009, at 4:31 PM, Alex Wang wrote:
>>>
>>>> Hi everyone,
>>>>
>>>> We have a web application that queries a Solr server through http.
>>>> What we would like to do is to customize the Solr server and hijack
>>>> the search request. If the user search term matches certain rules,
>>>> then redirect the user to a different page without even performing
>>>> any search in Solr, if the search term does not match any rules,
>>>> then perform search as usual.
>>>>
>>>> The question is how this can be achieved with the new
>>>> SearchComponent architecture.
>>>>
>>>> Any inputs would be appreciated!
>>>>
>>>> Alex
>>>
>>>--------------------------
>>>Grant Ingersoll
>>>http://www.lucidimagination.com/
>>>
>>>Search the Lucene ecosystem (Lucene/Solr/Nutch/Mahout/Tika/Droids)
>>>using Solr/Lucene:
>>>http://www.lucidimagination.com/search
>>
>>
>
>
>
>--
>--Noble Paul

Re: Hijacking Search Requests

Posted by Noble Paul നോബിള്‍ नोब्ळ् <no...@gmail.com>.
you may write a servlet filter which is applied before the
SolrDispatchFilter which applies the rules and do the redirect/forward


On Tue, Mar 31, 2009 at 2:54 AM, Alex Wang <aw...@crossview.com> wrote:
> Thanks Grant. Yes, I was trying to persuade our architect to do this from the web application itself, but he prefers to centralize this functionality on the Solr server rather than having all client applications implement their own.
>
> Cheers!
>
> Alex
>
>
>
>>-----Original Message-----
>>From: Grant Ingersoll [mailto:gsingers@apache.org]
>>Sent: Monday, March 30, 2009 4:49 PM
>>To: solr-user@lucene.apache.org
>>Subject: Re: Hijacking Search Requests
>>
>>I think this can be done with a load balancer such that you don't even
>>need to go to Solr, right?  Or, do you mean you want different
>>"results" from Solr itself?
>>
>>On Mar 30, 2009, at 4:31 PM, Alex Wang wrote:
>>
>>> Hi everyone,
>>>
>>> We have a web application that queries a Solr server through http.
>>> What we would like to do is to customize the Solr server and hijack
>>> the search request. If the user search term matches certain rules,
>>> then redirect the user to a different page without even performing
>>> any search in Solr, if the search term does not match any rules,
>>> then perform search as usual.
>>>
>>> The question is how this can be achieved with the new
>>> SearchComponent architecture.
>>>
>>> Any inputs would be appreciated!
>>>
>>> Alex
>>
>>--------------------------
>>Grant Ingersoll
>>http://www.lucidimagination.com/
>>
>>Search the Lucene ecosystem (Lucene/Solr/Nutch/Mahout/Tika/Droids)
>>using Solr/Lucene:
>>http://www.lucidimagination.com/search
>
>



-- 
--Noble Paul

RE: Hijacking Search Requests

Posted by Alex Wang <aw...@crossview.com>.
Thanks Grant. Yes, I was trying to persuade our architect to do this from the web application itself, but he prefers to centralize this functionality on the Solr server rather than having all client applications implement their own.

Cheers!

Alex



>-----Original Message-----
>From: Grant Ingersoll [mailto:gsingers@apache.org]
>Sent: Monday, March 30, 2009 4:49 PM
>To: solr-user@lucene.apache.org
>Subject: Re: Hijacking Search Requests
>
>I think this can be done with a load balancer such that you don't even
>need to go to Solr, right?  Or, do you mean you want different
>"results" from Solr itself?
>
>On Mar 30, 2009, at 4:31 PM, Alex Wang wrote:
>
>> Hi everyone,
>>
>> We have a web application that queries a Solr server through http.
>> What we would like to do is to customize the Solr server and hijack
>> the search request. If the user search term matches certain rules,
>> then redirect the user to a different page without even performing
>> any search in Solr, if the search term does not match any rules,
>> then perform search as usual.
>>
>> The question is how this can be achieved with the new
>> SearchComponent architecture.
>>
>> Any inputs would be appreciated!
>>
>> Alex
>
>--------------------------
>Grant Ingersoll
>http://www.lucidimagination.com/
>
>Search the Lucene ecosystem (Lucene/Solr/Nutch/Mahout/Tika/Droids)
>using Solr/Lucene:
>http://www.lucidimagination.com/search


Re: Hijacking Search Requests

Posted by Grant Ingersoll <gs...@apache.org>.
I think this can be done with a load balancer such that you don't even  
need to go to Solr, right?  Or, do you mean you want different  
"results" from Solr itself?

On Mar 30, 2009, at 4:31 PM, Alex Wang wrote:

> Hi everyone,
>
> We have a web application that queries a Solr server through http.  
> What we would like to do is to customize the Solr server and hijack  
> the search request. If the user search term matches certain rules,  
> then redirect the user to a different page without even performing  
> any search in Solr, if the search term does not match any rules,  
> then perform search as usual.
>
> The question is how this can be achieved with the new  
> SearchComponent architecture.
>
> Any inputs would be appreciated!
>
> Alex

--------------------------
Grant Ingersoll
http://www.lucidimagination.com/

Search the Lucene ecosystem (Lucene/Solr/Nutch/Mahout/Tika/Droids)  
using Solr/Lucene:
http://www.lucidimagination.com/search