From: Lars B. <L.J...@uv...> - 2012-10-29 16:16:13
|
Hi all, I'm working on a faceted search engine. In the facets code, I'd like to get the number of matches found by ft:query inside a hit, without running the hit through ft:query. As an example, I currently do for $b in util:catch("*", ft:query($coll//vk:book, $qterms), ()) order by ft:score($b) return $b Lucene scores, however, aren't really presentable to my target audience, so I tried order by count(kwic:expand($b)//exist:match) but this may take up to a half a minute to run. Using util:expand instead is no better. Is there a way to get just this count, without doing the actual expansion? I looked at the docs and found that text:match-count might do this, but that always returns zero (is it for the old full-text index?). TIA, Lars PS.: I know $coll//vk:book[ft:query(., $qterms)] is supposed to be faster than my current expression, but that doesn't work: it never returns any hits. -- Lars Buitinck Scientific programmer, ILPS University of Amsterdam |