We ended up using String newquery = query.replace(query, ":", 
with space in quotes after the ":".   It worked great. Now results come back 
even if you use
colon in the query.  And one can still use ":" as a special operator if there 
is no space 
afterwards.  Great suggestion.

Thanks!

Felix
-----------------------------------------------------
Finervista - http://www.finervista.com 

"Michael D. Curtin" <[EMAIL PROTECTED]> wrote: Felix Litman wrote:
> We want to be able to return a result regardless if users use a colon or not 
> in the query.  So 'work:' and 'work' query should still return same result.
> 
> With the current parser if a user enters 'work:'  with a ":" , Lucene does 
> not return anything :-(.   It seems to me the Lucene parser issue.... we are 
> wondering if there is any simple way to make the Lucene parser ignore the ":" 
> in the query?

The StandardAnalyzer already strips out the colons from the indexed 
text, so all you need to do is get rid of them in the query.  Would

   String newquery = query.replace(query, ":", " ");

work?  It uses a space as the new text so that two query words that 
happened to be separated by the colon would still be separate words ...

--MDC

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Reply via email to