Question about BooleanQuery

2012-08-23 Thread heikki
hello, I'm trying to construct a boolean query, but can't get it to return the results that I intend. Does anyone see what I'm doing wrong ? The query is like The idea is that it should return documents where someField_1 = 0 OR someField_2 = 0 AND booleanField_1 = false BUT NOT ( someField_1

Re: Question about BooleanQuery

2012-08-23 Thread Jack Krupansky
Step 1, fully parenthesize your boolean to show your desired order of execution. The Lucene BooleanQuery does not do a pure Boolean evaluation. You have the same sub-expression in your NOT clause - that's probably what guarantees zero results. And you have an unmatched right parenthesis at the

Re: Question about BooleanQuery

2012-08-23 Thread heikki
thanks Jack for your answer, however I'm not quite sure what to do with it: the query is like +( someField_1:0 someField_2:0 ) +booleanField_1:false -( +( someField_1:0 someField_2:0 ) +booleanField_2:true ) (I put this in 'raw' before, think it might not have shown up in

Re: Question about BooleanQuery

2012-08-23 Thread Jack Krupansky
Ah... the way you've phrased it, the nested NOT query will exclude docs even if "booleanField_1:false", so that will guarantee zero results. It seems like what you want is: +someField_1:0 +someField_2:0 +booleanField_1:false -booleanField_2:true In your original case, the parentheses were caus

Re: Question about BooleanQuery

2012-08-23 Thread heikki
OK, it's not the idea that the nested NOT query has got anything to do with booleanField_1, so I'll try to phrase very clearly what I want : the query should return docs where ( someField_1 = 0 OR someField_2 = 0) AND ( booleanField_1 = false ) AND ( NOT ( ( someField_1 = 0 OR someField_2 = 0 )

Re: Question about BooleanQuery

2012-08-23 Thread Jack Krupansky
And "(NOT booleanField_2 = true )" is really just "booleanField_2 = false", right? Unless you are looking for fields that are not populated with any value in addition to an explicit false value. -- Jack Krupansky -Original Message- From: heikki Sent: Thursday, August 23, 2012 9:13 AM

Re: Personalized ranking using pre-computed scores

2012-08-23 Thread Ian Lea
Using a FieldSelector is likely to speed up the doc.get() calls, but it is still liable to be slow. Can you use the lucene FieldCache? Some other memory cache? Payloads? -- Ian. On Wed, Aug 22, 2012 at 4:39 PM, Sebastian R. wrote: > Dear all, > > I am currently trying to implement a personal

Re: Personalized ranking using pre-computed scores

2012-08-23 Thread Sebastian R.
Yeah, I had already tried the FieldSelector. I don't know how I could use the FieldCache for the scores because of the high number of different score values. I'm now thinking of holding all the ranking values in memory and retrieve them during search time using a FieldCache of the post IDs. Downsid