You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lucene.apache.org by Simon Willnauer <si...@googlemail.com> on 2011/01/28 15:23:09 UTC
Weird Solr behavior if fq= is empty and FilterCache is disabled
Hey there,
I am seeing weird behavior if I search for a simple query via solr and
the fq param is empty. The cause of this seems that the QueryComponent
tries to parse the fq params and collects its values into a list which
is set to the RepsonseBuilder. But if the param is the empty string
(default if you use the admin interface) the response builder will
contain an empty list instead of null. Eventually this gets turned
into a MatchAllDocsQuery executed for every single request if
FilterCache is disabled. Yet in my case we don't use filters and have
filtercache disabled. I think this is a trap for users which are in
similar situation. This happens here in solr 1.4 but it seems to me
that this is the case on trunk too. So I would want to confirm that
before i open an issue. Fixing it is kind of trivial though.
Is this a known issue or a feature?
simon
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org
Re: Weird Solr behavior if fq= is empty and FilterCache is disabled
Posted by Simon Willnauer <si...@googlemail.com>.
fixed in rev 1064730 (trunk) & 1064761 (3x)
simon
On Fri, Jan 28, 2011 at 4:20 PM, Erick Erickson <er...@gmail.com> wrote:
> Yes, Yonik, all bigs fixed in Solr are "fee free" <G>.....
> Erick@Couldn'tResist.com
>
> On Fri, Jan 28, 2011 at 10:16 AM, Yonik Seeley <yo...@lucidimagination.com>
> wrote:
>>
>> On Fri, Jan 28, 2011 at 9:23 AM, Simon Willnauer
>> <si...@googlemail.com> wrote:
>> > Yet in my case we don't use filters and have
>> > filtercache disabled. I think this is a trap for users which are in
>> > similar situation.
>>
>> That situation should be super-rare - I've not seen anyone using solr
>> w/o somehow using filters (explicitly or implicitly), and it pretty
>> much always makes sense to have the filterCache. But if it's a
>> trivial bug to fix... fee free.
>>
>> -Yonik
>> http://lucidimagination.com
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
>> For additional commands, e-mail: dev-help@lucene.apache.org
>>
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org
Re: Weird Solr behavior if fq= is empty and FilterCache is disabled
Posted by Erick Erickson <er...@gmail.com>.
Yes, Yonik, all bigs fixed in Solr are "fee free" <G>.....
Erick@Couldn'tResist.com
On Fri, Jan 28, 2011 at 10:16 AM, Yonik Seeley
<yo...@lucidimagination.com>wrote:
> On Fri, Jan 28, 2011 at 9:23 AM, Simon Willnauer
> <si...@googlemail.com> wrote:
> > Yet in my case we don't use filters and have
> > filtercache disabled. I think this is a trap for users which are in
> > similar situation.
>
> That situation should be super-rare - I've not seen anyone using solr
> w/o somehow using filters (explicitly or implicitly), and it pretty
> much always makes sense to have the filterCache. But if it's a
> trivial bug to fix... fee free.
>
> -Yonik
> http://lucidimagination.com
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
> For additional commands, e-mail: dev-help@lucene.apache.org
>
>
Re: Weird Solr behavior if fq= is empty and FilterCache is disabled
Posted by Yonik Seeley <yo...@lucidimagination.com>.
On Fri, Jan 28, 2011 at 9:23 AM, Simon Willnauer
<si...@googlemail.com> wrote:
> Yet in my case we don't use filters and have
> filtercache disabled. I think this is a trap for users which are in
> similar situation.
That situation should be super-rare - I've not seen anyone using solr
w/o somehow using filters (explicitly or implicitly), and it pretty
much always makes sense to have the filterCache. But if it's a
trivial bug to fix... fee free.
-Yonik
http://lucidimagination.com
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org
Re: Weird Solr behavior if fq= is empty and FilterCache is disabled
Posted by Simon Willnauer <si...@googlemail.com>.
We can fix that easily i think
Index: solr/src/java/org/apache/solr/handler/component/QueryComponent.java
===================================================================
--- solr/src/java/org/apache/solr/handler/component/QueryComponent.java (revision
1064673)
+++ solr/src/java/org/apache/solr/handler/component/QueryComponent.java (working
copy)
@@ -107,7 +107,6 @@
List<Query> filters = rb.getFilters();
if (filters==null) {
filters = new ArrayList<Query>(fqs.length);
- rb.setFilters( filters );
}
for (String fq : fqs) {
if (fq != null && fq.trim().length()!=0) {
@@ -115,6 +114,12 @@
filters.add(fqp.getQuery());
}
}
+ // only set the filters if they are not empty otherwise
+ // fq=&someotherParam= will trigger all docs filter for every request
+ // if filter cache is disabled
+ if (!filters.isEmpty()) {
+ rb.setFilters( filters );
+ }
}
} catch (ParseException e) {
throw new SolrException(SolrException.ErrorCode.BAD_REQUEST, e);
seems like a bug to me really
On Fri, Jan 28, 2011 at 3:23 PM, Simon Willnauer
<si...@googlemail.com> wrote:
> Hey there,
>
> I am seeing weird behavior if I search for a simple query via solr and
> the fq param is empty. The cause of this seems that the QueryComponent
> tries to parse the fq params and collects its values into a list which
> is set to the RepsonseBuilder. But if the param is the empty string
> (default if you use the admin interface) the response builder will
> contain an empty list instead of null. Eventually this gets turned
> into a MatchAllDocsQuery executed for every single request if
> FilterCache is disabled. Yet in my case we don't use filters and have
> filtercache disabled. I think this is a trap for users which are in
> similar situation. This happens here in solr 1.4 but it seems to me
> that this is the case on trunk too. So I would want to confirm that
> before i open an issue. Fixing it is kind of trivial though.
>
> Is this a known issue or a feature?
>
> simon
>
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org