You are viewing a plain text version of this content. The canonical link for it is here.
Posted to solr-user@lucene.apache.org by Shawn Heisey <so...@elyograg.org> on 2012/06/01 23:50:31 UTC

Re: A few random questions about solr queries.

On 5/29/2012 4:18 AM, santamaria2 wrote:
> *3)* I've rummaged around a bit, looking for info on when to use q vs fq. I
> want to clear my doubts for a certain use case.
>
> Where should my date range queries go? In q or fq? The default settings in
> my site show results from the past 90 days with buttons to show stuff from
> the last month and week as well. But the user is allowed to use a slider to
> apply any date range... this is allowed, but it's not /that/ common.
> I definitely use fq for filtering various tags. Choosing a tag is a common
> activity.

I can't answer your facet questions, but this one I can.  If you are 
using the default relevancy ranking and you do not want the values in a 
given part of your search to affect the score, put it in a filter query 
(fq).  Also, if you are sorting all your search results in a 
deterministic way rather than using relevancy, use a filter query.

If you do want those values to affect the score, which is normal for 
fulltext fields, put your search clause in the regular query (q).  Most 
of the time, a date range is not something that you want to affect the 
relevancy score, so it is a perfect candidate for filter queries.

Thanks,
Shawn