lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Antony Bowesman <>
Subject Re: search on colon ":" ending words
Date Mon, 12 Feb 2007 21:25:28 GMT
Not sure if you're still after a solution, but I had a similar issue and I 
modified QueryParser.jj to not treat : as a field name terminator, so work: 
would then just be given as work: to the analyzer and treated as a search term.


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?
> any thoughts?
> Erick Erickson <> wrote: I've got to ask why you'd want
to search on colons. Why not just index the
> words without colons and search without them too? Let's say you index the
> word "work:" Do you really want to have a search on "work" fail?
> By and large, you're better off indexing and searching without
> punctuation....
> Best
> Erick
> On 1/28/07, Felix Litman  wrote:
>> Is there a simple way to turn off field-search syntax in the Lucene
>> parser, and have Lucene recognize words ending in a colon ":" as search
>> terms instead?
>> Such words are very common occurrences for our documents (or any plain
>> text), but Lucene does not seem to find them. :-(
>> Thank you,
>> Felix

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message