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 Mat Brown <ma...@patch.com> on 2009/09/22 20:49:29 UTC

No-op query for :q parameter?

Hi all,

If I have a set of filter queries that I'd like to apply but nothing
that I particularly would like to put into the :q parameter (since I'd
like all of the scopes to be cached), is there any problem with just
passing "[* TO *]" for the :q param? Any performance implications?

Thanks!
Mat

Re: No-op query for :q parameter?

Posted by Mat Brown <ma...@patch.com>.
Hey Shalin,

Thanks for the help. The particular attraction of filter queries is
that they are cached separately, and our application takes advantage
of that fact, since we often employ several filters in one search -
while the combinations of filters are numerous, the individual filters
comprise a small enough set that they can be effectively cached.

We actually do have a choice about whether to put something in :q - I
could always just arbitrarily pick one filter and put it in the :q
parameter instead of an :fq parameter. That's a good point about the
query result cache and '*:*' though - thanks.

Mat

On Tue, Sep 22, 2009 at 15:12, Shalin Shekhar Mangar
<sh...@gmail.com> wrote:
> On Wed, Sep 23, 2009 at 12:33 AM, Mat Brown <ma...@patch.com> wrote:
>
>> Thanks, Shalin. The "*:*" sounds good - so that'll definitely have no
>> effect on query performance?
>>
>>
> All query results are added to the query result cache so any cost is
> one-time only (until a commit happens or eviction happens). In any case, if
> you do not have anything to put in the query field, you have no choice :)
>
>
>> What I meant was, I'd like all of the queries that I'm using to
>> restrict search results to be cached (as filter queries are) - which
>> is why I don't have anything I'd particularly like to put into the :q
>> parameter.
>>
>>
> OK, thanks for clearing that up. Note that filters and queries are cached
> separately. A good article on this is on the wiki:
>
> http://wiki.apache.org/solr/FilterQueryGuidance
>
> --
> Regards,
> Shalin Shekhar Mangar.
>

Re: No-op query for :q parameter?

Posted by Shalin Shekhar Mangar <sh...@gmail.com>.
On Wed, Sep 23, 2009 at 12:33 AM, Mat Brown <ma...@patch.com> wrote:

> Thanks, Shalin. The "*:*" sounds good - so that'll definitely have no
> effect on query performance?
>
>
All query results are added to the query result cache so any cost is
one-time only (until a commit happens or eviction happens). In any case, if
you do not have anything to put in the query field, you have no choice :)


> What I meant was, I'd like all of the queries that I'm using to
> restrict search results to be cached (as filter queries are) - which
> is why I don't have anything I'd particularly like to put into the :q
> parameter.
>
>
OK, thanks for clearing that up. Note that filters and queries are cached
separately. A good article on this is on the wiki:

http://wiki.apache.org/solr/FilterQueryGuidance

-- 
Regards,
Shalin Shekhar Mangar.

Re: No-op query for :q parameter?

Posted by Mat Brown <ma...@patch.com>.
Thanks, Shalin. The "*:*" sounds good - so that'll definitely have no
effect on query performance?

What I meant was, I'd like all of the queries that I'm using to
restrict search results to be cached (as filter queries are) - which
is why I don't have anything I'd particularly like to put into the :q
parameter.

Mat

On Tue, Sep 22, 2009 at 15:00, Shalin Shekhar Mangar
<sh...@gmail.com> wrote:
> On Wed, Sep 23, 2009 at 12:19 AM, Mat Brown <ma...@patch.com> wrote:
>
>>
>> If I have a set of filter queries that I'd like to apply but nothing
>> that I particularly would like to put into the :q parameter (since I'd
>> like all of the scopes to be cached), is there any problem with just
>> passing "[* TO *]" for the :q param? Any performance implications?
>>
>
> You can use q=*:* to match all documents. [* TO *] will work too but it is
> applied on the default search field and I'm not sure of its performance
> characteristics.
>
> I'm not sure about what you mean by "I'd like all of the scopes to be
> cached".
>
> --
> Regards,
> Shalin Shekhar Mangar.
>

Re: No-op query for :q parameter?

Posted by Shalin Shekhar Mangar <sh...@gmail.com>.
On Wed, Sep 23, 2009 at 12:19 AM, Mat Brown <ma...@patch.com> wrote:

>
> If I have a set of filter queries that I'd like to apply but nothing
> that I particularly would like to put into the :q parameter (since I'd
> like all of the scopes to be cached), is there any problem with just
> passing "[* TO *]" for the :q param? Any performance implications?
>

You can use q=*:* to match all documents. [* TO *] will work too but it is
applied on the default search field and I'm not sure of its performance
characteristics.

I'm not sure about what you mean by "I'd like all of the scopes to be
cached".

-- 
Regards,
Shalin Shekhar Mangar.

RE: No-op query for :q parameter?

Posted by Fuad Efendi <fu...@efendi.ca>.
> is there any problem with just
> passing "[* TO *]" for the :q param? Any performance implications?


Only if you are using faceting on a field with high cardinality (such as tokenized, multivalued)
Additional parameters: how many docs do you retrieve in a single query? 100, 100000000, ... - lazy field loading? Sorting? etc