On Tue, Nov 30, 2010 at 3:09 PM, Yonik Seeley
<yo...@lucidimagination.com> wrote:
> On Tue, Nov 30, 2010 at 8:24 AM, Martin Grotzke
> <martin.grot...@googlemail.com> wrote:
>> Still I'm wondering, why this issue does not occur with the plain
>> example solr setup with 2 indexed docs. Any explanation?
>
> It's an old option you have in your solrconfig.xml that causes a
> different code path to be followed in Solr:
>
>   <!-- An optimization that attempts to use a filter to satisfy a search.
>         If the requested sort does not include score, then the filterCache
>         will be checked for a filter matching the query. If found, the filter
>         will be used as the source of document ids, and then the sort will be
>         applied to that. -->
>    <useFilterForSortedQuery>true</useFilterForSortedQuery>
>
> Most apps would be better off commenting that out or setting it to
> false.  It only makes sense when a high number of queries will be
> duplicated, but with different sorts.

Great, this sounds really promising, would be a very easy fix. I need
to check this tomorrow on our test/integration server if changing this
does the trick for us.

Though, I just enabled useFilterForSortedQuery in the solr 1.4.1
example and tested rows=0 with a sort param, which doesn't fail - a
correct/valid result is returned.
Is there any condition that has to be met additionally to produce the error?


>> One question: as leaving out sorting leads to better performance, this
>> should also be true for rows=0. Or is lucene/solr already that clever
>> that it makes this optimization (ignoring sort) automatically?
>
> Solr has always special-cased this case and avoided sorting altogether

Great, good to know!

Cheers,
Martin

Reply via email to