lucene-solr-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Yonik Seeley" <>
Subject Re: query syntax performance difference?
Date Sun, 14 Oct 2007 01:41:43 GMT
On 10/11/07, BrendanD <> wrote:
> Is there a difference in the performance for the following 2 variations on
> query syntax? The first query was a response from Solr by using a single fq
> parameter in the URL. The second query was a response from Solr by using
> separate fq parameter in the URL, one for each field.
> <str name="fq">
> product_is_active:true AND product_status_code:complete AND
> category_id:"1001570" AND attribute_id_value_en_pair:"1005758\:Elvis
> Presley"
> </str>
> vs:
> <arr name="fq">
>    <str>product_is_active:true</str>
>    <str>product_status_code:complete</str>
>    <str>category_id:"1001570"</str>
>    <str>attribute_id_value_en_pair:"1005758\:Elvis Presley"</str>
> </arr>
> I'm just wondering if the queries get executed differently and whether it's
> better to split out each individual query into it's own statement or combine
> them using the AND operator.

If they almost always appear together, then use an AND and put them in
the same filter.
If they are relatively independent, use different filters.  Having
solr intersect a few filters is normally very fast, so independent
filters is usually fine.


View raw message