You are viewing a plain text version of this content. The canonical link for it is here.
Posted to solr-commits@lucene.apache.org by Apache Wiki <wi...@apache.org> on 2007/01/12 12:27:16 UTC
[Solr Wiki] Update of "CommonQueryParameters" by ThorstenScherler
Dear Wiki user,
You have subscribed to a wiki page or wiki category on "Solr Wiki" for change notification.
The following page has been changed by ThorstenScherler:
http://wiki.apache.org/solr/CommonQueryParameters
------------------------------------------------------------------------------
This parameter can be used to specify a raw lucene query that can be used to restrict the super set of documents that can be returned, without influence score. It can be very useful for speeding up complex queries since they queries specified with fq are cached independently from the main query.
- This param can be specified multiple times, and the filters are additive.
+ This param can be specified multiple times, and the filters are additive. Do not try to add more then one filter to each fq, since only the first one will be taken. So instead of {{{
+ fq=date:[* TO 26-10-2006] section:0}}} you need to use {{{
+ fq=date:[* TO 26-10-2006]&fq=section:0}}}
== fl ==
Re: [Solr Wiki] Update of "CommonQueryParameters" by ThorstenScherler
Posted by Yonik Seeley <yo...@apache.org>.
On 1/12/07, Apache Wiki <wi...@apache.org> wrote:
> The following page has been changed by ThorstenScherler:
> http://wiki.apache.org/solr/CommonQueryParameters
>
> - This param can be specified multiple times, and the filters are additive.
> + This param can be specified multiple times, and the filters are additive. Do not try to add more then one filter to each fq, since only the first one will be taken. So instead of {{{
> + fq=date:[* TO 26-10-2006] section:0}}} you need to use {{{
> + fq=date:[* TO 26-10-2006]&fq=section:0}}}
Actually, that's not quite right... you can add multiple clauses to a single fq.
Your example fq is in lucene query syntax and thus means
date:[* TO 26-10-2006] OR section:0
You could do fq=+date:[* TO 26-10-2006] +section:0
and that would be functionally equivalent to
fq=date:[* TO 26-10-2006]&fq=section:0
The difference comes mostly in caching... fq's are cached
independently, so for best efficiency, one would want to use the
former if those clauses appeared together often, and the latter of
they were relatively independent.
-Yonik