Re: help for preprocessing the query

2008-05-13 Thread Umar Shah
On Mon, May 12, 2008 at 10:30 PM, Shalin Shekhar Mangar [EMAIL PROTECTED] wrote: You'll *not* write a servlet. You'll write implement the Filter interface http://java.sun.com/j2ee/sdk_1.3/techdocs/api/javax/servlet/Filter.html In the doFilter method, you'll create a ServletRequestWrapper

Re: help for preprocessing the query

2008-05-13 Thread Shalin Shekhar Mangar
Did you put a filter-mapping in web.xml? On Tue, May 13, 2008 at 4:20 PM, Umar Shah [EMAIL PROTECTED] wrote: On Mon, May 12, 2008 at 10:30 PM, Shalin Shekhar Mangar [EMAIL PROTECTED] wrote: You'll *not* write a servlet. You'll write implement the Filter interface

Re: help for preprocessing the query

2008-05-13 Thread Umar Shah
On Tue, May 13, 2008 at 4:39 PM, Shalin Shekhar Mangar [EMAIL PROTECTED] wrote: Did you put a filter-mapping in web.xml? no, I just did that and it seems to be working... what is filter-mapping required for? On Tue, May 13, 2008 at 4:20 PM, Umar Shah [EMAIL PROTECTED] wrote: On Mon,

Re: help for preprocessing the query

2008-05-13 Thread Noble Paul നോബിള്‍ नोब्ळ्
http://java.sun.com/products/servlet/Filters.html this is a servlet container feature BTW , this may not be a right forum for this topic. --Noble On Tue, May 13, 2008 at 5:04 PM, Umar Shah [EMAIL PROTECTED] wrote: On Tue, May 13, 2008 at 4:39 PM, Shalin Shekhar Mangar [EMAIL PROTECTED] wrote:

help for preprocessing the query

2008-05-12 Thread Umar Shah
Hi, Due some requirement I need to transform the user queries before passing it to the standard handler in Solr, can anyone suggest me the best way to do this. I will need to use a transfomation class that would provide functions to process the input query 'qIn' and transform it to the

Re: help for preprocessing the query

2008-05-12 Thread Koji Sekiguchi
Hi Umar, You may be able to preprocess your request parameter in your servlet filter. In the doFilter() method, you do: ServletRequest myRequest = new MyServletRequestWrapper( request ); : chain.doFilter( myRequest, response ); And you have MyServletRequestWrapper that extends

Re: help for preprocessing the query

2008-05-12 Thread Umar Shah
On Mon, May 12, 2008 at 2:50 PM, Koji Sekiguchi [EMAIL PROTECTED] wrote: Hi Umar, You may be able to preprocess your request parameter in your servlet filter. In the doFilter() method, you do: ServletRequest myRequest = new MyServletRequestWrapper( request ); Thanks for your response,

Re: help for preprocessing the query

2008-05-12 Thread Shalin Shekhar Mangar
ServletRequest and ServletRequestWrapper are part of the Java servlet-api (not Solr). Basically, Koji is hinting at writing a ServletFilter implementation (again using servlet-api) and creating a wrapper ServletRequest which modifies the underlying request params which can then be used by Solr.

Re: help for preprocessing the query

2008-05-12 Thread Umar Shah
On Mon, May 12, 2008 at 8:42 PM, Shalin Shekhar Mangar [EMAIL PROTECTED] wrote: ServletRequest and ServletRequestWrapper are part of the Java servlet-api (not Solr). Basically, Koji is hinting at writing a ServletFilter implementation (again using servlet-api) and creating a wrapper

Re: help for preprocessing the query

2008-05-12 Thread Koji Sekiguchi
Shalin Shekhar Mangar write: ServletRequest and ServletRequestWrapper are part of the Java servlet-api (not Solr). Basically, Koji is hinting at writing a ServletFilter implementation (again using servlet-api) and creating a wrapper ServletRequest which modifies the underlying request params

Re: help for preprocessing the query

2008-05-12 Thread Grant Ingersoll
I haven't written one, but I _think_ you could just implement a QParser that does the transformation. See the LuceneQParser or the DismaxQParser. On May 12, 2008, at 4:59 AM, Umar Shah wrote: Hi, Due some requirement I need to transform the user queries before passing it to the

Re: help for preprocessing the query

2008-05-12 Thread Shalin Shekhar Mangar
You'll *not* write a servlet. You'll write implement the Filter interface http://java.sun.com/j2ee/sdk_1.3/techdocs/api/javax/servlet/Filter.html In the doFilter method, you'll create a ServletRequestWrapper which changes the incoming param. Then you'll call chain.doFilter with the new request