[KinoSearch] more abstract interfaces to kinosearch
Hans Dieter Pearcey
hdp at pobox.com
Fri Jun 29 05:45:01 PDT 2007
I keep forgetting that I'm not using all of kinosearch's functionality. In
particular, I don't actually care about scoring, because I'm using KS like a
database and always sort by some inherent property of the documents.
On Thu, Jun 28, 2007 at 11:00:21PM -0700, Marvin Humphrey wrote:
>
> On Jun 28, 2007, at 6:54 PM, Hans Dieter Pearcey wrote:
>
> >I can't find any way to do the OR, there, in a Query, only with
> >PolyFilter.
>
> BooleanQuery?
I don't see how I'd do this just in terms of matching. Maybe I don't
understand SHOULD?
> >"filters should be reused because they cache stuff, while queries
> >can be
> >one-off because they don't",
>
> In general, that's the case.
>
> Filters are on-off, so their result can be cached in a BitVector.
>
> Caching the result of a Scorer (derived from a Query) would be much
> more expensive, because you'd need to keep 1 32-bit doc number and 1
> float score around for each match. In a worst case scenario -- every
> doc matches -- we're talkin' 64 times as expensive as a Filter.
There's another question here that I may not have made explicit enough. If
some particular selection mechanism is available both as a Query and as a
Filter -- e.g. BooleanQuery, which you can also use as part of a Queryfilter --
is there any reason to prefer one over the other, assuming that you are (as I
am) only interested in matching, not scoring? Do Filters have any kind of
startup overhead compared to Queries, etc.?
> I think the ultimate solution will be to make MatchFieldQuery public
> and give it a constant score which defaults to zero. Then it could
> be combined with a RangeFilter to produce the same effect as a
> ConstantScoreRangeQuery. MatchFieldQuery is relatively simple, and
> lets you do things that require kludges otherwise.
I had found MatchFieldQuery, and thought that that might work, but didn't know
enough internals to be sure. I like this idea. What can I do to make it work?
hdp.
More information about the KinoSearch
mailing list