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 Derek Westfall <dw...@TradelineInc.com> on 2005/07/28 00:42:37 UTC
Regex for legal user search input
Is there a way to allow users to use + and - and special operators in
free-text searches, but also allow them to search for a last name like
Smith-Jones? (which I'd have to escape?)
Is there a regular expression to determine/fix this kind of user input
so it is queryparser-legal?
Ie they can't just type * or + in the search box.
How are y'all handling this kind of thing?
Derek
---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org
Re: Regex for legal user search input
Posted by Erik Hatcher <er...@ehatchersolutions.com>.
What version of Lucene are you using? There was a change that
helped with that situation such that interior +/- was not considered
an operator. That changed is in the 1.4 versions - might you be
running a previous version of Lucene?
Erik
On Jul 27, 2005, at 6:42 PM, Derek Westfall wrote:
> Is there a way to allow users to use + and - and special operators in
> free-text searches, but also allow them to search for a last name like
> Smith-Jones? (which I'd have to escape?)
>
> Is there a regular expression to determine/fix this kind of user input
> so it is queryparser-legal?
>
> Ie they can't just type * or + in the search box.
>
> How are y'all handling this kind of thing?
>
> Derek
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
> For additional commands, e-mail: java-user-help@lucene.apache.org
>
---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org