You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@lucene.apache.org by Kelvin Tan <li...@relevanz.com> on 2004/03/05 09:21:07 UTC

Query validation in web app

Lucene reacts pretty badly to non-wellformed queries, not throwing a 
checked/unchecked Exception but throwing an Error. The error message is also 
unintelligible to a user (non-developer).

How are people checking/validating queries from a web-app?

I have some checked-in code in sandbox that does javascript validation, but I 
wonder if there's a smarter way to do query validation..

k


---------------------------------------------------------------------
To unsubscribe, e-mail: lucene-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: lucene-user-help@jakarta.apache.org


Re: Query validation in web app

Posted by Erik Hatcher <er...@ehatchersolutions.com>.
There was one condition we tightened up recently where a ParseException 
was not being thrown, but now it is.

This was when there were too many boolean queries, and this exception 
is now converted to a ParseException.

	Erik

On Mar 5, 2004, at 4:46 AM, Kelvin Tan wrote:

> On Fri, 5 Mar 2004 04:18:29 -0500, Erik Hatcher said:
>> Kelvin,
>>
>> In what scenarios does QueryParser fail without throwing a
>> ParseException?
>>
>> I think we should fix those cases to ensure a ParseException is 
>> thrown.
>>
>> Erik
>>
>>
>
> Sorry, my bad. Was it ever throwing Errors? Probably not, but somehow 
> I had the
> impression it was..
>
> Kelvin
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: lucene-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: lucene-user-help@jakarta.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: lucene-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: lucene-user-help@jakarta.apache.org


Re: Query validation in web app

Posted by Kelvin Tan <li...@relevanz.com>.
On Fri, 5 Mar 2004 04:18:29 -0500, Erik Hatcher said:
> Kelvin,
> 
> In what scenarios does QueryParser fail without throwing a
> ParseException?
> 
> I think we should fix those cases to ensure a ParseException is thrown.
> 
> Erik
> 
> 

Sorry, my bad. Was it ever throwing Errors? Probably not, but somehow I had the 
impression it was..

Kelvin


---------------------------------------------------------------------
To unsubscribe, e-mail: lucene-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: lucene-user-help@jakarta.apache.org


Re: Query validation in web app

Posted by Erik Hatcher <er...@ehatchersolutions.com>.
Kelvin,

In what scenarios does QueryParser fail without throwing a 
ParseException?

I think we should fix those cases to ensure a ParseException is thrown.

	Erik


On Mar 5, 2004, at 3:21 AM, Kelvin Tan wrote:

> Lucene reacts pretty badly to non-wellformed queries, not throwing a
> checked/unchecked Exception but throwing an Error. The error message 
> is also
> unintelligible to a user (non-developer).
>
> How are people checking/validating queries from a web-app?
>
> I have some checked-in code in sandbox that does javascript 
> validation, but I
> wonder if there's a smarter way to do query validation..
>
> k
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: lucene-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: lucene-user-help@jakarta.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: lucene-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: lucene-user-help@jakarta.apache.org


Re: Query validation in web app

Posted by Kelvin Tan <li...@relevanz.com>.
Neither! :-) I was just wondering if there were better ways to do it, that's 
all. I'm a regex newbie and I found it rather difficult to validate the entire 
Lucene query syntax (including escaping!) using regex. 

Anyway, I'm writing unit tests for the query validator right now courtesy of 
jsunit...

Kelvin

On Fri, 5 Mar 2004 13:21:55 -0800, Dror Matalon said:
> I was responding to
> 
>>> How are people checking/validating queries from a web-app?
> 
> So should I be embarrassed or should Kelvin be flattered :-)?
> 
> 
> On Fri, Mar 05, 2004 at 12:12:35PM -0800, Otis Gospodnetic wrote:
>> Funny - Kelvin Tan is the author of that code :)
>> 
>> Otis
>> 
>> --- Dror Matalon <dr...@zapatec.com> wrote:
>>> On Fri, Mar 05, 2004 at 04:21:07PM +0800, Kelvin Tan wrote:
>>>> Lucene reacts pretty badly to non-wellformed queries, not throwing
>>> a
>>>> checked/unchecked Exception but throwing an Error. The error
>>> message is also
>>>> unintelligible to a user (non-developer).
>>>> 
>>>> How are people checking/validating queries from a web-app?
>>> 
>>> Look at the javascript validator in the Lucene sandbox. A quite
>>> elegant
>>> solution, unless you're opposed to using javascript.
>>> 
>>>> 
>>>> I have some checked-in code in sandbox that does javascript
>>> validation, but I
>>>> wonder if there's a smarter way to do query validation..
>>>> 
>>>> k
>>>> 
>>>> 
>>> ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: lucene-user-unsubscribe@jakarta.apache.org
>>>> For additional commands, e-mail:
>>> lucene-user-help@jakarta.apache.org
>>>> 
>>> 
>>> --
>>> Dror Matalon
>>> Zapatec Inc
>>> 1700 MLK Way
>>> Berkeley, CA 94709
>>> http://www.fastbuzz.com
>>> http://www.zapatec.com
>>> 
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: lucene-user-unsubscribe@jakarta.apache.org
>>> For additional commands, e-mail: lucene-user-help@jakarta.apache.org
>> 
>> 
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: lucene-user-unsubscribe@jakarta.apache.org
>> For additional commands, e-mail: lucene-user-help@jakarta.apache.org




---------------------------------------------------------------------
To unsubscribe, e-mail: lucene-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: lucene-user-help@jakarta.apache.org


Re: Query validation in web app

Posted by Dror Matalon <dr...@zapatec.com>.
I was responding to 

> > How are people checking/validating queries from a web-app?

So should I be embarrassed or should Kelvin be flattered :-)?


On Fri, Mar 05, 2004 at 12:12:35PM -0800, Otis Gospodnetic wrote:
> Funny - Kelvin Tan is the author of that code :)
> 
> Otis
> 
> --- Dror Matalon <dr...@zapatec.com> wrote:
> > On Fri, Mar 05, 2004 at 04:21:07PM +0800, Kelvin Tan wrote:
> > > Lucene reacts pretty badly to non-wellformed queries, not throwing
> > a
> > > checked/unchecked Exception but throwing an Error. The error
> > message is also
> > > unintelligible to a user (non-developer).
> > > 
> > > How are people checking/validating queries from a web-app?
> > 
> > Look at the javascript validator in the Lucene sandbox. A quite
> > elegant
> > solution, unless you're opposed to using javascript.
> > 
> > > 
> > > I have some checked-in code in sandbox that does javascript
> > validation, but I
> > > wonder if there's a smarter way to do query validation..
> > > 
> > > k
> > > 
> > > 
> > >
> > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: lucene-user-unsubscribe@jakarta.apache.org
> > > For additional commands, e-mail:
> > lucene-user-help@jakarta.apache.org
> > > 
> > 
> > -- 
> > Dror Matalon
> > Zapatec Inc 
> > 1700 MLK Way
> > Berkeley, CA 94709
> > http://www.fastbuzz.com
> > http://www.zapatec.com
> > 
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: lucene-user-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail: lucene-user-help@jakarta.apache.org
> > 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: lucene-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: lucene-user-help@jakarta.apache.org
> 

-- 
Dror Matalon
Zapatec Inc 
1700 MLK Way
Berkeley, CA 94709
http://www.fastbuzz.com
http://www.zapatec.com

---------------------------------------------------------------------
To unsubscribe, e-mail: lucene-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: lucene-user-help@jakarta.apache.org


Re: Query validation in web app

Posted by Otis Gospodnetic <ot...@yahoo.com>.
Funny - Kelvin Tan is the author of that code :)

Otis

--- Dror Matalon <dr...@zapatec.com> wrote:
> On Fri, Mar 05, 2004 at 04:21:07PM +0800, Kelvin Tan wrote:
> > Lucene reacts pretty badly to non-wellformed queries, not throwing
> a
> > checked/unchecked Exception but throwing an Error. The error
> message is also
> > unintelligible to a user (non-developer).
> > 
> > How are people checking/validating queries from a web-app?
> 
> Look at the javascript validator in the Lucene sandbox. A quite
> elegant
> solution, unless you're opposed to using javascript.
> 
> > 
> > I have some checked-in code in sandbox that does javascript
> validation, but I
> > wonder if there's a smarter way to do query validation..
> > 
> > k
> > 
> > 
> >
> ---------------------------------------------------------------------
> > To unsubscribe, e-mail: lucene-user-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail:
> lucene-user-help@jakarta.apache.org
> > 
> 
> -- 
> Dror Matalon
> Zapatec Inc 
> 1700 MLK Way
> Berkeley, CA 94709
> http://www.fastbuzz.com
> http://www.zapatec.com
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: lucene-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: lucene-user-help@jakarta.apache.org
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: lucene-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: lucene-user-help@jakarta.apache.org


Re: Query validation in web app

Posted by Dror Matalon <dr...@zapatec.com>.
On Fri, Mar 05, 2004 at 04:21:07PM +0800, Kelvin Tan wrote:
> Lucene reacts pretty badly to non-wellformed queries, not throwing a
> checked/unchecked Exception but throwing an Error. The error message is also
> unintelligible to a user (non-developer).
> 
> How are people checking/validating queries from a web-app?

Look at the javascript validator in the Lucene sandbox. A quite elegant
solution, unless you're opposed to using javascript.

> 
> I have some checked-in code in sandbox that does javascript validation, but I
> wonder if there's a smarter way to do query validation..
> 
> k
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: lucene-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: lucene-user-help@jakarta.apache.org
> 

-- 
Dror Matalon
Zapatec Inc 
1700 MLK Way
Berkeley, CA 94709
http://www.fastbuzz.com
http://www.zapatec.com

---------------------------------------------------------------------
To unsubscribe, e-mail: lucene-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: lucene-user-help@jakarta.apache.org