Re: filter cache and negative filter query

2011-05-19 Thread Juan Antonio Farré Basurte
> lookups to work with an arbitrary query, you would either need to changed > the cache structure from Query=>DocSet to a mapping of > Query=>[DocSet,inverseionBit] and store the same cache value needs needs > with two keys -- both the positive and the negative; or you keep the Well, I don't k

Re: filter cache and negative filter query

2011-05-19 Thread Juan Antonio Farré Basurte
> : query that in fact returns the "negative" results. As a simple example, > : I believe that, for a boolean field, -field:true is exactly the same as > : +field:false, but the former is a negative query and the latter is a > > that's not strictly true in all cases... > > * if the field is m

Re: filter cache and negative filter query

2011-05-18 Thread Chris Hostetter
: What I don't like is that it systematically uses the positive version. : Sometimes the negative version will give many less results (for example, : in some cases I filter by documents not having a given field, and there : are very few of them). I think it would be much better that solr the

Re: filter cache and negative filter query

2011-05-18 Thread Juan Antonio Farré Basurte
Mmm... I had wondered whether solr reused filters this way (not having both the positive and negative versions) and I'm glad to see it does indeed reuse them. What I don't like is that it systematically uses the positive version. Sometimes the negative version will give many less results (for exa

Re: filter cache and negative filter query

2011-05-17 Thread Markus Jelsma
, that's not what i see while testing right now. Queries with -one OR -two return less documents than a either operand does on its own, this is with LuceneQParser. I haven't done extensive testing since i rarely use boolean algebra in Lucene or Solr. > Oops, you're right, I had misremembere

Re: filter cache and negative filter query

2011-05-17 Thread Markus Jelsma
> On Tue, May 17, 2011 at 6:17 PM, Markus Jelsma > > wrote: > > I'm not sure. The filter cache uses your filter as a key and a negation > > is a different key. You can check this easily in a controlled > > environment by issueing these queries and watching the filter cache > > statistics. > > G

Re: filter cache and negative filter query

2011-05-17 Thread Jonathan Rochkind
Oops, you're right, I had misremembered --- Solr 1.4.1 "lucene" qp handles pure negative fine, it's Solr 1.4.1 _dismax_ that does not. Although, here's one, not actually related to this thread, that DOESN'T work in Solr 1.4.1 lucene query parser. Curious if it's been fixed in Solr 3.1. &def

Re: filter cache and negative filter query

2011-05-17 Thread Markus Jelsma
Using q works just as one would expect as well ;) I think you confuse using negation to find documents that don't _have_ a specific field. In that case, a simple negation doesn't work indeed. > Wait, will a pure negative filter query actually work then, even though > a pure negative lucene 'q' w

Re: filter cache and negative filter query

2011-05-17 Thread Markus Jelsma
Such a negation works just as one would expect. q=*:* q=*:*&fq=-type:text/html q=*:*&fq=type:text/html Well, that adds up , doesn't it ;) > 1. I don't think Solr will re-use the filter cache in that situation, > although I'm not sure. But I comment anyway because, not what you asked > but s

Re: filter cache and negative filter query

2011-05-17 Thread Yonik Seeley
On Tue, May 17, 2011 at 6:17 PM, Markus Jelsma wrote: > I'm not sure. The filter cache uses your filter as a key and a negation is a > different key. You can check this easily in a controlled environment by > issueing these queries and watching the filter cache statistics. Gotta hate crossing ema

Re: filter cache and negative filter query

2011-05-17 Thread Jonathan Rochkind
Wait, will a pure negative filter query actually work then, even though a pure negative lucene 'q' won't? WOAH, it WILL. Okay, ignore my last message. But, okay, can someone explain THAT one to me? How come &q=-history does NOT work with Solr 1.4.1 lucene query parser, but &q=something&fq=-

Re: filter cache and negative filter query

2011-05-17 Thread Jonathan Rochkind
1. I don't think Solr will re-use the filter cache in that situation, although I'm not sure. But I comment anyway because, not what you asked but something else that will trip you up with your example: 2. In fact, a pure-negative query like that doesn't work _at all_ in the default solr/lucene

Re: filter cache and negative filter query

2011-05-17 Thread Markus Jelsma
I'm not sure. The filter cache uses your filter as a key and a negation is a different key. You can check this easily in a controlled environment by issueing these queries and watching the filter cache statistics. > If I have a query with a filter query such as : " q=art&fq=history" and > then r

Re: filter cache and negative filter query

2011-05-17 Thread Yonik Seeley
On Tue, May 17, 2011 at 6:07 PM, Burton-West, Tom wrote: > If I have a query with a filter query such as : " q=art&fq=history" and then > run a second query  "q=art&fq=-history", will Solr realize that it can use > the cached results of the previous filter query "history"  (in the filter > cach

filter cache and negative filter query

2011-05-17 Thread Burton-West, Tom
If I have a query with a filter query such as : " q=art&fq=history" and then run a second query "q=art&fq=-history", will Solr realize that it can use the cached results of the previous filter query "history" (in the filter cache) or will it not realize this and have to actually do a second fi