jackrabbit-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Philipp Bunge <b...@crimson.ch>
Subject Aggregating Search Scores
Date Thu, 08 Jul 2010 11:36:15 GMT
Hi all,

I was wondering if it is possible to aggregate the scores for joined
columns in an SQL-2 query. We want to order the nodes found according
to scores produced by matches on joined descendant nodes.

For example, let's assume we have some "file" nodes that have a
property called "tags". We want to search for words contained in the
tags and list the "folders" containing the matching files ordered by
the score of the tag search.
The example below shows that the files get different scores from the
CONTAINS constraint but the folders all have the same score.

Query : SELECT folder.* FROM [xyz:folder] AS folder LEFT OUTER JOIN
[xyz:file] AS file ON ISSAMENODE(file, folder, [images/holidays])
WHERE CONTAINS(file.tags, 'Mexico') OR CONTAINS(file.tags, 'HongKong')

Score of file row /filesystem/folders/mexico/images/holidays is 4.00581169128418
Score of folder row /filesystem/folders/mexico is 6.474369525909424
Score of file row /filesystem/folders/hongkong/images/holidays is
8.092962265014648
Score of folder row /filesystem/folders/hongkong is 6.474369525909424

With the queries that we are currently trying to run, the scores of
the nodes found are not aggregated on their containing nodes. Is it
possible to aggregate the scores in such a way?

Thanks in advance,
Philipp

Mime
View raw message