Luca Barbieri
2010-Oct-05 10:04 UTC
[Xapian-discuss] get_matches_estimated and value range
Hello, i've some problems with my query. I have a database where the documents have a date stored to value 0. I need to know the trend for a boolean query: example, I want to know how may documents are indexed by "foo" in different value ranges. I proceed building the query: Xapian::Query((foo:(pos=1) AND VALUE_RANGE 0 1286264160 1286264249)) and Xapian::Query((foo:(pos=1) AND VALUE_RANGE 0 1286264250 1286264339)) and so on... If I try to evaluate a quick estimate with: matches = enquire.get_mset(0, 0) matches.get_matches_estimated(); is it normal that the value range in my query is not evaluated? For each range i try, the estimated value is always the same, giving me a flat report. -- --------------------- Luca Barbieri
On Tue, Oct 05, 2010 at 12:04:36PM +0200, Luca Barbieri wrote:> is it normal that the value range in my query is not evaluated? For each > range i try, the estimated value is always the same, giving me a flat > report.If you ask for 0 matches, no documents will be considered - the estimates given in this case are based only on the statistics available about the terms and values involved. The estimate could sometimes be better here, but probably not to the extent you are hoping for I'm afraid. The estimate (and min/max) should be 0 when the value range falls completely outside the [lower bound, upper bound] range. Currently that isn't checked for, but I'm just testing a fix, and will commit it shortly assuming the rest of the testsuite passes. The bounds also don't make use of the count of set values which the chert backend stores - if there's no value set in a slot for some documents, that can be used to reduce the maximum number of documents which can match a value range on that slot. I'll take a look at making use of this once the above change is committed. Cheers, Olly
Possibly Parallel Threads
- Incorrect get_matches_estimated() of Xapian::Mset
- Very far out and static get_matches_estimated
- Obtaining actual match count if using set_collapse_key()
- [PATCH] drm/nouveau: fix missing spin_unlock in failure path
- [PATCH] drm/nouveau: enlarge GART aperture