Okay I think I found it. Let me know if this makes sense (also for
those curious about this).

1) The IndexSearcher will create a FilteredQuery using the
RANDOM_ACCESS_STRATEGY by default (IndexSearcher#wrapFilter).

2) When the searcher requests the scorer, the FilteredQuery uses the
FilterStrategy to retrieve the scorer (FilterStrategy#filteredScorer)

3) The RandomAccessFilterStrategy seems to use a heuristic of whether
or not to use the leapfrog strategy when the first document returned
by the filter is < 100. (RandomAccessFilterStrategy#useRandomAccess).

My simple test had < 100 docs hence why it never went down this leap
frog approach in my debugging.

Next question though is what is the significance of this  < 100? Is
this supposed to be a heuristic for determining the sparseness of the
filter bit set?

Thanks again
Amit

On Sat, Oct 20, 2012 at 7:12 PM, Amit Nithian <anith...@gmail.com> wrote:
> Thanks. So I was poking through this and see that the filters are
> calculated up front and stored as docsets that get intersected and
> passed into Lucene in the filter. The question though is that
> somewhere in the IndexSearcher and somewhere into the scorer it does
> this but I can't quite find where.
>
> Thanks
> Amit
>
> On Sat, Oct 20, 2012 at 5:22 PM, Mikhail Khludnev
> <mkhlud...@griddynamics.com> wrote:
>> Amit,
>>
>> Sure. this method
>> https://github.com/apache/lucene-solr/blob/trunk/solr/core/src/java/org/apache/solr/search/SolrIndexSearcher.java#L796beside
>> some other stuff calculates fq's docset intersection which is
>> supplied into filtered search call
>> https://github.com/apache/lucene-solr/blob/trunk/solr/core/src/java/org/apache/solr/search/SolrIndexSearcher.java#L1474
>>
>> You are welcome.
>>
>> On Sun, Oct 21, 2012 at 12:00 AM, Amit Nithian <anith...@gmail.com> wrote:
>>
>>> Hi all,
>>>
>>> Quick question. I've been reading up on the filter query and how it's
>>> implemented and the multiple articles I see keep referring to this
>>> notion of leap frogging and filter query execution in parallel with
>>> the main query. Question: Can someone point me to the code that does
>>> this so I can better understand?
>>>
>>> Thanks!
>>> Amit
>>>
>>
>>
>>
>> --
>> Sincerely yours
>> Mikhail Khludnev
>> Tech Lead
>> Grid Dynamics
>>
>> <http://www.griddynamics.com>
>>  <mkhlud...@griddynamics.com>

Reply via email to