2009/9/25 Jean-Francois Dockes <jf at dockes.org>
> I am not using 1.1 yet, so I tried the first approach, but there seems to
> be a problem with it: if there are few or no candidate documents, the
> MatchDecider is not called often or at all, and in consequence the time
> after which the query can be cancelled is unpredictable. This would be a
> problem for example when searching for a rare phrase made of common words
> ("to be or not to be").
>
Ah - interesting point, and well described.
> Would the PostingSource approach avoid this issue ?
>
No, it won't. When a phrase like that is being processed, the matcher will
be iterating through the matching phrases, and won't get up to the top of
the tree to check the posting source until it finds a match.
I suppose an alternative approach is to forcibly kill the thread performing
the search (though this isn't possible on all platforms, IIRC).
Alternatively, it might be better to work on making sure queries don't go on
so long that the user gets bored! There are various improvements to the
performance of phrase search in the 1.1 branch, which might help if that's
your main bottleneck.
--
Richard