lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From stephane vaucher <vauc...@LUB.UMontreal.CA>
Subject Re: QueryParser
Date Tue, 19 Nov 2002 23:07:45 GMT
Hi Otis,

I've tested the following. I don't know if I'm hitting expected 
behaviour, but it seems suspicious:

258,262d257
<
<     public void testPhraseBoost() throws Exception{
<         assertQueryEquals("(a AND b) OR c", null, "(+a +b) c");
<         assertQueryEquals("(a AND b)^2 c", null, "(+a +b)^2.0 c");
<     }

--> junit result

There was 1 failure:
1) 
testPhraseBoost(org.apache.lucene.queryParser.TestQueryParser)junit.framework.AssertionFailedError:

Query /(a AND b)^2 c/ yielded /+a +b/, expecting /(+a +b)^2.0 c/
    at 
org.apache.lucene.queryParser.TestQueryParser.assertQueryEquals(Unknown 
Source)
    at 
org.apache.lucene.queryParser.TestQueryParser.testPhraseBoost(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)

Stephane


Otis Gospodnetic wrote:

>Maybe it would be good if you could send some unit test code this way
>so that we can properly populate
>org.apache.lucene.queryParser.TestQueryParser.java with tests that will
>reveal bugs, such as the potential bug that you are reporting.
>
>Thanks,
>Otis
>
>
>
>--- stephane vaucher <vaucher@LUB.UMontreal.CA> wrote:
>
>>Hello lucene gurus,
>>
>>I've been experimenting with the QueryParser supplied with lucene and
>>
>>have a question. I've read from the FAQ that the grammar is the
>>following:
>>
>>Query ::= Clause ( [ Conjunction ] Clause ) *
>>Conjunction ::= 'AND' | 'OR' | '||'
>>Clause ::= [ Modifier ] [ FieldName ':' ] BasicClause [ Boost ]
>>Modifier ::= '-' | '+' | '!' | 'NOT'
>>BasicClause ::= ( Term | Phrase | | PrefixQuery '(' Query ')'
>>PrefixQuery ::= Term '*'
>>Phrase ::= '"' Term * '"'
>>Boost ::= '^' DecimalDigit+ '.' DecimalDigit+
>>Term ::= <a-word-or-token-to-match>
>>FieldName ::= <name-of-an-indexed-field>
>>
>> From what I've gathered was that we can have a request like the
>>following:
>>a) (snow AND removal) OR foo
>>b) (snow AND removal)^2 OR foo
>>
>>However, when I print the result(query) of the parsing, I have the 
>>following results:
>>a) (+snow +remov al) foo --> OK
>>b)  +snow +removal --> ??? I lose the foo and there is no boost
>>
>>I haven't seen any posts about this case, so I don't know if I'm
>>doing 
>>something wrong or simply weird enough that it hasn't been tested ( I
>>
>>haven't seen any tests in 
>>org.apache.lucene.queryParser.TestQueryParser.java)...
>>
>>My environment:
>>
>>I'm using Lucene-1.2 production release
>>on:
>>Linux RH 7.0
>>with:
>>java version "1.4.1"
>>Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.1-b21)
>>Java HotSpot(TM) Client VM (build 1.4.1-b21, mixed mode)
>>
>>Thanks,
>>Stephane Vaucher
>>Software designer
>>CIRANO
>>
>>
>>
>>
>>--
>>To unsubscribe, e-mail:  
>><mailto:lucene-user-unsubscribe@jakarta.apache.org>
>>For additional commands, e-mail:
>><mailto:lucene-user-help@jakarta.apache.org>
>>
>
>
>__________________________________________________
>Do you Yahoo!?
>Yahoo! Web Hosting - Let the expert host your site
>http://webhosting.yahoo.com
>
>--
>To unsubscribe, e-mail:   <mailto:lucene-user-unsubscribe@jakarta.apache.org>
>For additional commands, e-mail: <mailto:lucene-user-help@jakarta.apache.org>
>
>



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


Mime
View raw message