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
<[email protected]> 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: [email protected]
For additional commands, e-mail: [email protected]