Re: Query madness with NOTs...

2004-01-23 Thread Otis Gospodnetic
Redirecting to lucene-user

--- Jim Hargrave [EMAIL PROTECTED] wrote:
 Can anyone tell me why these two queries would produce different
 results:
  
 +A -B
  
 A -(-B) 

A and +A are not the same thing when you have multiple terms in a
query.

 Also, we are having a hard time understanding why the Query parser
 takes this
 query: A AND NOT B and returns this +A +(-B). Shouldn't this be
 +A -B?

Maybe it should.  QueryParser is not the smartest piece of code,
unfortunately, and this issue has been discussed several times before. 
It looks like QP is just translating things 'nicely' left to right and
not looking for 'AND NOT' and turning that into '-'.

Otis

 The
 first gives incorrect results, the later works as expected.
  
  
 Jim 
  
  
 


__
Do you Yahoo!?
Yahoo! SiteBuilder - Free web site building tool. Try it!
http://webhosting.yahoo.com/ps/sb/

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



Re: Query madness with NOTs...

2004-01-23 Thread Jim Hargrave
Thanks Otis,
 
(We are developing our own customized query parser - so I thought the dev group
was more appropriate.)
 
 Sorry. I forgot a + on the second query. Should be:
 
+A -B

+A -(-B)
 
My friend explained this as -B is nothing and -(nothing) is everything. When
you AND A with everything you get a different result as A AND NOT B. IS this
right?
 
But I think you have already answered my main question. We already have a
customized version of QueryParser so we will probably need to fix these problems
in order to generate the right query. You say these things have been brought up
before, but not fixed. Is the solution considered difficult? I'll take a look
myself - if I make progress I'll repost with the code.
 
Jim
 
--- Jim Hargrave [EMAIL PROTECTED] wrote:
 Can anyone tell me why these two queries would produce different
 results:
  
 +A -B
  
 A -(-B) 

A and +A are not the same thing when you have multiple terms in a
query.

 Also, we are having a hard time understanding why the Query parser
 takes this
 query: A AND NOT B and returns this +A +(-B). Shouldn't this be
 +A -B?

Maybe it should.  QueryParser is not the smartest piece of code,
unfortunately, and this issue has been discussed several times before. 
It looks like QP is just translating things 'nicely' left to right and
not looking for 'AND NOT' and turning that into '-'.

Otis

The
 first gives incorrect results, the later works as expected.
  
  
 Jim 
  
  
 



Re: Query madness with NOTs...

2004-01-23 Thread Morus Walter
Otis Gospodnetic writes:
 Redirecting to lucene-user
 
 --- Jim Hargrave [EMAIL PROTECTED] wrote:
  Can anyone tell me why these two queries would produce different
  results:
   
  +A -B
   
  A -(-B) 
 
 A and +A are not the same thing when you have multiple terms in a
 query.
 
Hmm. As far as I understood boolean queries so far
a -b and +a -b 
should be the same (while a b -c and +a +b -c are different of course).

a -(-b) on the other side contains a boolean query only searching for -b.
Lucene can not handle this type of query. I'm not sure what happens in this
case. But AFAIK you should never use a boolean query containing only 
prohibited terms in a query. 
If I test this, I don't get any results for a -(-b) and the same result
for 'a' and 'a +(-b)'.
The query parser patch I added yesterday to bugzilla, drops such queries.

  Also, we are having a hard time understanding why the Query parser
  takes this
  query: A AND NOT B and returns this +A +(-B). Shouldn't this be
  +A -B?
 
a AND NOT b IS parsed to +a -b by lucenes standard query parser.
Don't know where you found +a +(-b).

+a +(-b) would be wrong in the above sense.

Morus

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



Re: Lucene search result no stable

2004-01-23 Thread Ardor Wei
Thanks, Morus, Our real web server, database and the
directory Lucene writes in physically share the same
computer. File system is Win FAT.

For java.io.tmpdir, do you mean I need to explicitly
set it as system environment variable or set it in a
property file?

Thanks again!

--- Morus Walter [EMAIL PROTECTED]
wrote:
 Ardor Wei writes:
  
  What might be the problem? How to solve it?
  Any suggestion or idea will be appreciated.
  
 The only problem with locking I saw so far is that
 you have
 to make sure that the temp dir is the same for all
 applications.
 Lucene 1.3 stores it's lock in the directory that is
 defined by the
 system property java.io.tmpdir.
 I had one component running under tomcat and one
 from the shell
 and they used different temp dirs which is fatal in
 this case.
 
 Apart from this it depends pretty much on your
 environment.
 I'm using lucene on linux on local filesystems.
 Other operating
 systems or network filesystems may influence
 locking.
 
 Morus
 

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


__
Do you Yahoo!?
Yahoo! SiteBuilder - Free web site building tool. Try it!
http://webhosting.yahoo.com/ps/sb/

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