You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lucene.apache.org by Kristian Hermsdorf <kr...@ifbus.de> on 2003/01/20 15:28:27 UTC

bug in escaping special characters

Hi everyone ...
 
I think I found a bug in lucene query mechanism. QueryParser does mask 
spechial charakters but doesn't unmask them. So a search for field:a\:b did 
really search for a\:b in field (and not for a:b).
 
I added a few lines in QueryParser.jj to fix this issue.
 
I also added ' ' to _ESCAPED_CHAR to enable searches like field:hello\ 
world.
 
I attach QueryParser.jj and bugfix.diff and hope these changes does not 
collide with other thinks...
 
 
bye
 
Kristian
-- 
ACRONYM: Acronym Causing Recursion, Obviously Numbing Your Mind  
 
Kristian Hermsdorf
 
interface:projects gmbh
Tollkewitzer Straße  49
01277 Dresden
 
 
tel.: ++49-351-3 18 09 39
 
mail: Kristian.Hermsdorf@interface-business.de
priv: kristian@entropus.de

Re: bug in escaping special characters

Posted by Kristian Hermsdorf <kr...@ifbus.de>.
Hi

that would only work if you have a token "hello" and another token "world".

If you have a single Token "hello world" you would not find that token.

Imagine untokenized fields with values like "c:/my 
documents/my:special:file". You need to escape the '/' and ':' and ' '  ... 
otherwise you would search for "c:/my" OR "documents/my:special:file".

Kristian


On Wed, 22 Jan 2003 09:51:25 -0500, Erik Hatcher 
<li...@ehatchersolutions.com> wrote:

> On Monday, January 20, 2003, at 09:28  AM, Kristian Hermsdorf wrote:
>> I also added ' ' to _ESCAPED_CHAR to enable searches like field:hello\ 
>> world.
>
> what about field:"hello world" - that works, right?
>
>
> --
> To unsubscribe, e-mail:   <mailto:lucene-dev- 
> unsubscribe@jakarta.apache.org>
> For additional commands, e-mail: <mailto:lucene-dev- 
> help@jakarta.apache.org>
>
>
>



-- 
ACRONYM: Acronym Causing Recursion, Obviously Numbing Your Mind  

Kristian Hermsdorf

interface:projects gmbh		
Tollkewitzer Straße  49		
01277 Dresden			


tel.: ++49-351-3 18 09 39

mail: Kristian.Hermsdorf@interface-business.de
priv: kristian@entropus.de

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: bug in escaping special characters

Posted by Erik Hatcher <li...@ehatchersolutions.com>.
On Monday, January 20, 2003, at 09:28  AM, Kristian Hermsdorf wrote:
> I also added ' ' to _ESCAPED_CHAR to enable searches like field:hello\ 
> world.

what about field:"hello world" - that works, right?


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: bug in escaping special characters

Posted by Kristian Hermsdorf <kr...@ifbus.de>.
Hi

I applied the changes to the actual cvs-checkout (on 2003-01-30).

I also fixed the escaped backslash bug and run the junit test's again but 
they still fail (see test-log).

Actually I still don't understand the tests.
public void testEscaped() throws Exception {
  Analyzer a = new WhitespaceAnalyzer();
  assertQueryEquals("\\[brackets", a, "\\[brackets");
  assertQueryEquals("\\[brackets", null, "brackets");
  assertQueryEquals("\\\\", a, "\\\\");
  assertQueryEquals("\\+blah", a, "\\+blah");
  assertQueryEquals("\\(blah", a, "\\(blah");
}

Why should search for "\\[brackets" return "\\[brackets" when using an 
analyzer. Doesn't mean esaping that the escaping char should vanish? Who is 
the one that removes the escape-chars?

so long

Kristian



On Sat, 25 Jan 2003 21:07:37 -0800 (PST), Otis Gospodnetic 
<ot...@yahoo.com> wrote:

> Sorry, I'm not sure if I follow everything you said, but judging from
> that JUnit output in your message it looks like your changes now just
> get rid of _all_ \ characters, which is, I believe, wrong.
> "\\" is a "\" escaped with a "\".  In this case the second "\" needs to
> remain, and your modifications eliminate it, and JUnit tests start
> failing.
> Anyhow, what problem are you trying to fix?
>
> Otis
>
>
> --- Kristian Hermsdorf <kr...@ifbus.de> wrote:
>> Hi Otis
>>
>> unfortunately the junit-test weren't successful but I think they
>> might be incorrect or I misunderstand escaping.
>>
>> Though it seems to me, that the analyzer does affect the result of
>> the junit-test I don't understand why it does. I thought the tokens
>> produced by the analyzer should not contain the escaping-char anymore, 
>> does they?
>>
>> Should not result the query-string for \[something in a query for 
>> [something ?
>>
>> Maybee you could enlighten me, how the junit-test is meant and how
>> escaping should work.
>> thanks
>>
>> Kristian
>>
>>
>> public void testEscaped() throws Exception {
>> Analyzer a = new WhitespaceAnalyzer();
>> assertQueryEquals("\\[brackets", a, "\\[brackets");        ...fails
>> assertQueryEquals("\\[brackets", null, "brackets");        ...works
>> assertQueryEquals("\\\\", a, "\\\\");
>> assertQueryEquals("\\+blah", a, "\\+blah");
>> assertQueryEquals("\\(blah", a, "\\(blah");
>> }
>>
>> Query /\[brackets/ yielded /[brackets/, expecting /\[brackets/
>> junit.framework.AssertionFailedError: Query /\[brackets/ yielded 
>> /[brackets/, expecting /\[brackets/
>> 	at
>>
> org.apache.lucene.queryParser.TestQueryParser.assertQueryEquals(Unknown
>>
>> Source)
>> 	at org.apache.lucene.queryParser.TestQueryParser.testEscaped(Unknown
>>
>> Source)
>> 	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>> 	at
>>
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>> 	at
>>
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>>
>>
>>
>> On Wed, 22 Jan 2003 17:40:38 -0800 (PST), Otis Gospodnetic 
>> <ot...@yahoo.com> wrote:
>>
>> > Hello Kristian, thanks for the contribution.
>> >
>> > Two quick questions:
>> >
>> > 1. do all unit tests still pass after your changes? (ant test-unit)
>> > 2. could you please make the diff against the latest
>> QueryParser.jj?
>> > (it seems like your QueryParser.jj is from June 2002 :))
>> >
>> > Thanks!
>> > Otis
>> >
>> >
>> > --- Kristian Hermsdorf <kr...@ifbus.de> wrote:
>> >> Hi everyone ...
>> >> I think I found a bug in lucene query mechanism. QueryParser does
>> >> mask spechial charakters but doesn't unmask them. So a search for
>> >> field:a\:b did really search for a\:b in field (and not for a:b).
>> >> I added a few lines in QueryParser.jj to fix this issue.
>> >> I also added ' ' to _ESCAPED_CHAR to enable searches like
>> >> field:hello\ world.
>> >> I attach QueryParser.jj and bugfix.diff and hope these changes
>> does
>> >> not collide with other thinks...
>> >>
>> >> bye
>> >> Kristian
>> >> -- ACRONYM: Acronym Causing Recursion, Obviously Numbing Your Mind
>> >> Kristian Hermsdorf
>> >> interface:projects gmbh
>> >> Tollkewitzer Straße  49
>> >> 01277 Dresden
>> >>
>> >> tel.: ++49-351-3 18 09 39
>> >> mail: Kristian.Hermsdorf@interface-business.de
>> >> priv: kristian@entropus.de
>> >
>> >> ATTACHMENT part 2 application/octet-stream name=QueryParser.jj
>> >
>> >
>> >> ATTACHMENT part 3 application/octet-stream name=bugfix.diff
>> >> --
>> >> To unsubscribe, e-mail:  <mailto:lucene-dev->> 
>> unsubscribe@jakarta.apache.org>
>> >> For additional commands, e-mail:
>> > <ma...@jakarta.apache.org>
>> >
>> >
>> > __________________________________________________
>> > Do you Yahoo!?
>> > Yahoo! Mail Plus - Powerful. Affordable. Sign up now.
>> > http://mailplus.yahoo.com
>> >
>> > --
>> > To unsubscribe, e-mail:   <mailto:lucene-dev-> 
>> unsubscribe@jakarta.apache.org>
>> > For additional commands, e-mail: <mailto:lucene-dev-> 
>> help@jakarta.apache.org>
>> >
>> >
>> >
>>
>>
>>
>> -- ACRONYM: Acronym Causing Recursion, Obviously Numbing Your Mind
>>
>> Kristian Hermsdorf
>>
>> interface:projects gmbh		
>> Tollkewitzer Straße  49		
>> 01277 Dresden			
>>
>>
>> tel.: ++49-351-3 18 09 39
>>
>> mail: Kristian.Hermsdorf@interface-business.de
>> priv: kristian@entropus.de
>>
>> --
>> To unsubscribe, e-mail:  <mailto:lucene-dev- 
>> unsubscribe@jakarta.apache.org>
>> For additional commands, e-mail:
>> <ma...@jakarta.apache.org>
>>
>
>
> __________________________________________________
> Do you Yahoo!?
> Yahoo! Mail Plus - Powerful. Affordable. Sign up now.
> http://mailplus.yahoo.com
>
> --
> To unsubscribe, e-mail:   <mailto:lucene-dev- 
> unsubscribe@jakarta.apache.org>
> For additional commands, e-mail: <mailto:lucene-dev- 
> help@jakarta.apache.org>
>
>
>



-- 
ACRONYM: Acronym Causing Recursion, Obviously Numbing Your Mind  

Kristian Hermsdorf

interface:projects gmbh		
Tollkewitzer Straße  49		
01277 Dresden			


tel.: ++49-351-3 18 09 39

mail: Kristian.Hermsdorf@interface-business.de
priv: kristian@entropus.de

Re: bug in escaping special characters

Posted by Kristian Hermsdorf <kr...@ifbus.de>.
Hi

I'll have a look to the "\\"-problem (think I really missed that point) an 
will run test's again....
I'm afraid it could take some time.

bye

Kristian

On Sat, 25 Jan 2003 21:07:37 -0800 (PST), Otis Gospodnetic 
<ot...@yahoo.com> wrote:

> Sorry, I'm not sure if I follow everything you said, but judging from
> that JUnit output in your message it looks like your changes now just
> get rid of _all_ \ characters, which is, I believe, wrong.
> "\\" is a "\" escaped with a "\".  In this case the second "\" needs to
> remain, and your modifications eliminate it, and JUnit tests start
> failing.
> Anyhow, what problem are you trying to fix?
>
> Otis
>
>
> --- Kristian Hermsdorf <kr...@ifbus.de> wrote:
>> Hi Otis
>>
>> unfortunately the junit-test weren't successful but I think they
>> might be incorrect or I misunderstand escaping.
>>
>> Though it seems to me, that the analyzer does affect the result of
>> the junit-test I don't understand why it does. I thought the tokens
>> produced by the analyzer should not contain the escaping-char anymore, 
>> does they?
>>
>> Should not result the query-string for \[something in a query for 
>> [something ?
>>
>> Maybee you could enlighten me, how the junit-test is meant and how
>> escaping should work.
>> thanks
>>
>> Kristian
>>
>>
>> public void testEscaped() throws Exception {
>> Analyzer a = new WhitespaceAnalyzer();
>> assertQueryEquals("\\[brackets", a, "\\[brackets");        ...fails
>> assertQueryEquals("\\[brackets", null, "brackets");        ...works
>> assertQueryEquals("\\\\", a, "\\\\");
>> assertQueryEquals("\\+blah", a, "\\+blah");
>> assertQueryEquals("\\(blah", a, "\\(blah");
>> }
>>
>> Query /\[brackets/ yielded /[brackets/, expecting /\[brackets/
>> junit.framework.AssertionFailedError: Query /\[brackets/ yielded 
>> /[brackets/, expecting /\[brackets/
>> 	at
>>
> org.apache.lucene.queryParser.TestQueryParser.assertQueryEquals(Unknown
>>
>> Source)
>> 	at org.apache.lucene.queryParser.TestQueryParser.testEscaped(Unknown
>>
>> Source)
>> 	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>> 	at
>>
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>> 	at
>>
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>>
>>
>>
>> On Wed, 22 Jan 2003 17:40:38 -0800 (PST), Otis Gospodnetic 
>> <ot...@yahoo.com> wrote:
>>
>> > Hello Kristian, thanks for the contribution.
>> >
>> > Two quick questions:
>> >
>> > 1. do all unit tests still pass after your changes? (ant test-unit)
>> > 2. could you please make the diff against the latest
>> QueryParser.jj?
>> > (it seems like your QueryParser.jj is from June 2002 :))
>> >
>> > Thanks!
>> > Otis
>> >
>> >
>> > --- Kristian Hermsdorf <kr...@ifbus.de> wrote:
>> >> Hi everyone ...
>> >> I think I found a bug in lucene query mechanism. QueryParser does
>> >> mask spechial charakters but doesn't unmask them. So a search for
>> >> field:a\:b did really search for a\:b in field (and not for a:b).
>> >> I added a few lines in QueryParser.jj to fix this issue.
>> >> I also added ' ' to _ESCAPED_CHAR to enable searches like
>> >> field:hello\ world.
>> >> I attach QueryParser.jj and bugfix.diff and hope these changes
>> does
>> >> not collide with other thinks...
>> >>
>> >> bye
>> >> Kristian
>> >> -- ACRONYM: Acronym Causing Recursion, Obviously Numbing Your Mind
>> >> Kristian Hermsdorf
>> >> interface:projects gmbh
>> >> Tollkewitzer Straße  49
>> >> 01277 Dresden
>> >>
>> >> tel.: ++49-351-3 18 09 39
>> >> mail: Kristian.Hermsdorf@interface-business.de
>> >> priv: kristian@entropus.de
>> >
>> >> ATTACHMENT part 2 application/octet-stream name=QueryParser.jj
>> >
>> >
>> >> ATTACHMENT part 3 application/octet-stream name=bugfix.diff
>> >> --
>> >> To unsubscribe, e-mail:  <mailto:lucene-dev->> 
>> unsubscribe@jakarta.apache.org>
>> >> For additional commands, e-mail:
>> > <ma...@jakarta.apache.org>
>> >
>> >
>> > __________________________________________________
>> > Do you Yahoo!?
>> > Yahoo! Mail Plus - Powerful. Affordable. Sign up now.
>> > http://mailplus.yahoo.com
>> >
>> > --
>> > To unsubscribe, e-mail:   <mailto:lucene-dev-> 
>> unsubscribe@jakarta.apache.org>
>> > For additional commands, e-mail: <mailto:lucene-dev-> 
>> help@jakarta.apache.org>
>> >
>> >
>> >
>>
>>
>>
>> -- ACRONYM: Acronym Causing Recursion, Obviously Numbing Your Mind
>>
>> Kristian Hermsdorf
>>
>> interface:projects gmbh		
>> Tollkewitzer Straße  49		
>> 01277 Dresden			
>>
>>
>> tel.: ++49-351-3 18 09 39
>>
>> mail: Kristian.Hermsdorf@interface-business.de
>> priv: kristian@entropus.de
>>
>> --
>> To unsubscribe, e-mail:  <mailto:lucene-dev- 
>> unsubscribe@jakarta.apache.org>
>> For additional commands, e-mail:
>> <ma...@jakarta.apache.org>
>>
>
>
> __________________________________________________
> Do you Yahoo!?
> Yahoo! Mail Plus - Powerful. Affordable. Sign up now.
> http://mailplus.yahoo.com
>
> --
> To unsubscribe, e-mail:   <mailto:lucene-dev- 
> unsubscribe@jakarta.apache.org>
> For additional commands, e-mail: <mailto:lucene-dev- 
> help@jakarta.apache.org>
>
>
>



-- 
ACRONYM: Acronym Causing Recursion, Obviously Numbing Your Mind  

Kristian Hermsdorf

interface:projects gmbh		
Tollkewitzer Straße  49		
01277 Dresden			


tel.: ++49-351-3 18 09 39

mail: Kristian.Hermsdorf@interface-business.de
priv: kristian@entropus.de

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


Re: bug in escaping special characters

Posted by Otis Gospodnetic <ot...@yahoo.com>.
Sorry, I'm not sure if I follow everything you said, but judging from
that JUnit output in your message it looks like your changes now just
get rid of _all_ \ characters, which is, I believe, wrong.
"\\" is a "\" escaped with a "\".  In this case the second "\" needs to
remain, and your modifications eliminate it, and JUnit tests start
failing.
Anyhow, what problem are you trying to fix?

Otis


--- Kristian Hermsdorf <kr...@ifbus.de> wrote:
> Hi Otis
> 
> unfortunately the junit-test weren't successful but I think they
> might be 
> incorrect or I misunderstand escaping.
> 
> Though it seems to me, that the analyzer does affect the result of
> the 
> junit-test I don't understand why it does. I thought the tokens
> produced by 
> the analyzer should not contain the escaping-char anymore, does they?
> 
> Should not result the query-string for \[something in a query for 
> [something ?
> 
> Maybee you could enlighten me, how the junit-test is meant and how
> escaping 
> should work.
> thanks
> 
> Kristian
> 
> 
> public void testEscaped() throws Exception {
>     Analyzer a = new WhitespaceAnalyzer();
>     assertQueryEquals("\\[brackets", a, "\\[brackets");        
> ...fails
>     assertQueryEquals("\\[brackets", null, "brackets");        
> ...works
>     assertQueryEquals("\\\\", a, "\\\\");
>     assertQueryEquals("\\+blah", a, "\\+blah");
>     assertQueryEquals("\\(blah", a, "\\(blah");
>   }
> 
> Query /\[brackets/ yielded /[brackets/, expecting /\[brackets/
> junit.framework.AssertionFailedError: Query /\[brackets/ yielded 
> /[brackets/, expecting /\[brackets/
> 	at
>
org.apache.lucene.queryParser.TestQueryParser.assertQueryEquals(Unknown
> 
> Source)
> 	at org.apache.lucene.queryParser.TestQueryParser.testEscaped(Unknown
> 
> Source)
> 	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> 	at 
>
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
> 	at 
>
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
> 
> 
> 
> On Wed, 22 Jan 2003 17:40:38 -0800 (PST), Otis Gospodnetic 
> <ot...@yahoo.com> wrote:
> 
> > Hello Kristian, thanks for the contribution.
> >
> > Two quick questions:
> >
> > 1. do all unit tests still pass after your changes? (ant test-unit)
> > 2. could you please make the diff against the latest
> QueryParser.jj?
> > (it seems like your QueryParser.jj is from June 2002 :))
> >
> > Thanks!
> > Otis
> >
> >
> > --- Kristian Hermsdorf <kr...@ifbus.de> wrote:
> >> Hi everyone ...
> >> I think I found a bug in lucene query mechanism. QueryParser does
> >> mask spechial charakters but doesn't unmask them. So a search for
> >> field:a\:b did really search for a\:b in field (and not for a:b).
> >> I added a few lines in QueryParser.jj to fix this issue.
> >> I also added ' ' to _ESCAPED_CHAR to enable searches like
> >> field:hello\ world.
> >> I attach QueryParser.jj and bugfix.diff and hope these changes
> does
> >> not collide with other thinks...
> >>
> >> bye
> >> Kristian
> >> -- ACRONYM: Acronym Causing Recursion, Obviously Numbing Your Mind
> >> Kristian Hermsdorf
> >> interface:projects gmbh
> >> Tollkewitzer Stra�e  49
> >> 01277 Dresden
> >>
> >> tel.: ++49-351-3 18 09 39
> >> mail: Kristian.Hermsdorf@interface-business.de
> >> priv: kristian@entropus.de
> >
> >> ATTACHMENT part 2 application/octet-stream name=QueryParser.jj
> >
> >
> >> ATTACHMENT part 3 application/octet-stream name=bugfix.diff
> >> --
> >> To unsubscribe, e-mail:  <mailto:lucene-dev- 
> >> unsubscribe@jakarta.apache.org>
> >> For additional commands, e-mail:
> > <ma...@jakarta.apache.org>
> >
> >
> > __________________________________________________
> > Do you Yahoo!?
> > Yahoo! Mail Plus - Powerful. Affordable. Sign up now.
> > http://mailplus.yahoo.com
> >
> > --
> > To unsubscribe, e-mail:   <mailto:lucene-dev- 
> > unsubscribe@jakarta.apache.org>
> > For additional commands, e-mail: <mailto:lucene-dev- 
> > help@jakarta.apache.org>
> >
> >
> >
> 
> 
> 
> -- 
> ACRONYM: Acronym Causing Recursion, Obviously Numbing Your Mind  
> 
> Kristian Hermsdorf
> 
> interface:projects gmbh		
> Tollkewitzer Stra�e  49		
> 01277 Dresden			
> 
> 
> tel.: ++49-351-3 18 09 39
> 
> mail: Kristian.Hermsdorf@interface-business.de
> priv: kristian@entropus.de
> 
> --
> To unsubscribe, e-mail:  
> <ma...@jakarta.apache.org>
> For additional commands, e-mail:
> <ma...@jakarta.apache.org>
> 


__________________________________________________
Do you Yahoo!?
Yahoo! Mail Plus - Powerful. Affordable. Sign up now.
http://mailplus.yahoo.com

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: bug in escaping special characters

Posted by Kristian Hermsdorf <kr...@ifbus.de>.
Hi Otis

unfortunately the junit-test weren't successful but I think they might be 
incorrect or I misunderstand escaping.

Though it seems to me, that the analyzer does affect the result of the 
junit-test I don't understand why it does. I thought the tokens produced by 
the analyzer should not contain the escaping-char anymore, does they?

Should not result the query-string for \[something in a query for 
[something ?

Maybee you could enlighten me, how the junit-test is meant and how escaping 
should work.
thanks

Kristian


public void testEscaped() throws Exception {
    Analyzer a = new WhitespaceAnalyzer();
    assertQueryEquals("\\[brackets", a, "\\[brackets");         ...fails
    assertQueryEquals("\\[brackets", null, "brackets");         ...works
    assertQueryEquals("\\\\", a, "\\\\");
    assertQueryEquals("\\+blah", a, "\\+blah");
    assertQueryEquals("\\(blah", a, "\\(blah");
  }

Query /\[brackets/ yielded /[brackets/, expecting /\[brackets/
junit.framework.AssertionFailedError: Query /\[brackets/ yielded 
/[brackets/, expecting /\[brackets/
	at org.apache.lucene.queryParser.TestQueryParser.assertQueryEquals(Unknown 
Source)
	at org.apache.lucene.queryParser.TestQueryParser.testEscaped(Unknown 
Source)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
	at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)



On Wed, 22 Jan 2003 17:40:38 -0800 (PST), Otis Gospodnetic 
<ot...@yahoo.com> wrote:

> Hello Kristian, thanks for the contribution.
>
> Two quick questions:
>
> 1. do all unit tests still pass after your changes? (ant test-unit)
> 2. could you please make the diff against the latest QueryParser.jj?
> (it seems like your QueryParser.jj is from June 2002 :))
>
> Thanks!
> Otis
>
>
> --- Kristian Hermsdorf <kr...@ifbus.de> wrote:
>> Hi everyone ...
>> I think I found a bug in lucene query mechanism. QueryParser does
>> mask spechial charakters but doesn't unmask them. So a search for
>> field:a\:b did really search for a\:b in field (and not for a:b).
>> I added a few lines in QueryParser.jj to fix this issue.
>> I also added ' ' to _ESCAPED_CHAR to enable searches like
>> field:hello\ world.
>> I attach QueryParser.jj and bugfix.diff and hope these changes does
>> not collide with other thinks...
>>
>> bye
>> Kristian
>> -- ACRONYM: Acronym Causing Recursion, Obviously Numbing Your Mind
>> Kristian Hermsdorf
>> interface:projects gmbh
>> Tollkewitzer Straße  49
>> 01277 Dresden
>>
>> tel.: ++49-351-3 18 09 39
>> mail: Kristian.Hermsdorf@interface-business.de
>> priv: kristian@entropus.de
>
>> ATTACHMENT part 2 application/octet-stream name=QueryParser.jj
>
>
>> ATTACHMENT part 3 application/octet-stream name=bugfix.diff
>> --
>> To unsubscribe, e-mail:  <mailto:lucene-dev- 
>> unsubscribe@jakarta.apache.org>
>> For additional commands, e-mail:
> <ma...@jakarta.apache.org>
>
>
> __________________________________________________
> Do you Yahoo!?
> Yahoo! Mail Plus - Powerful. Affordable. Sign up now.
> http://mailplus.yahoo.com
>
> --
> To unsubscribe, e-mail:   <mailto:lucene-dev- 
> unsubscribe@jakarta.apache.org>
> For additional commands, e-mail: <mailto:lucene-dev- 
> help@jakarta.apache.org>
>
>
>



-- 
ACRONYM: Acronym Causing Recursion, Obviously Numbing Your Mind  

Kristian Hermsdorf

interface:projects gmbh		
Tollkewitzer Straße  49		
01277 Dresden			


tel.: ++49-351-3 18 09 39

mail: Kristian.Hermsdorf@interface-business.de
priv: kristian@entropus.de

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: bug in escaping special characters

Posted by Otis Gospodnetic <ot...@yahoo.com>.
Hello Kristian, thanks for the contribution.

Two quick questions:

1. do all unit tests still pass after your changes? (ant test-unit)
2. could you please make the diff against the latest QueryParser.jj?
(it seems like your QueryParser.jj is from June 2002 :))

Thanks!
Otis


--- Kristian Hermsdorf <kr...@ifbus.de> wrote:
> Hi everyone ...
>  
> I think I found a bug in lucene query mechanism. QueryParser does
> mask 
> spechial charakters but doesn't unmask them. So a search for
> field:a\:b did 
> really search for a\:b in field (and not for a:b).
>  
> I added a few lines in QueryParser.jj to fix this issue.
>  
> I also added ' ' to _ESCAPED_CHAR to enable searches like
> field:hello\ 
> world.
>  
> I attach QueryParser.jj and bugfix.diff and hope these changes does
> not 
> collide with other thinks...
>  
>  
> bye
>  
> Kristian
> -- 
> ACRONYM: Acronym Causing Recursion, Obviously Numbing Your Mind  
>  
> Kristian Hermsdorf
>  
> interface:projects gmbh
> Tollkewitzer Stra�e  49
> 01277 Dresden
>  
>  
> tel.: ++49-351-3 18 09 39
>  
> mail: Kristian.Hermsdorf@interface-business.de
> priv: kristian@entropus.de

> ATTACHMENT part 2 application/octet-stream name=QueryParser.jj


> ATTACHMENT part 3 application/octet-stream name=bugfix.diff
> --
> To unsubscribe, e-mail:  
> <ma...@jakarta.apache.org>
> For additional commands, e-mail:
<ma...@jakarta.apache.org>


__________________________________________________
Do you Yahoo!?
Yahoo! Mail Plus - Powerful. Affordable. Sign up now.
http://mailplus.yahoo.com

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>