You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@jackrabbit.apache.org by Apache Wiki <wi...@apache.org> on 2007/05/15 16:05:32 UTC

[Jackrabbit Wiki] Update of "SimilaritySearch" by MarcelReutegger

Dear Wiki user,

You have subscribed to a wiki page or wiki category on "Jackrabbit Wiki" for change notification.

The following page has been changed by MarcelReutegger:
http://wiki.apache.org/jackrabbit/SimilaritySearch

New page:
Starting with version, 1.4 Jackrabbit allows you to search for nodes that are similar to an existing node.

The functions are called rep:similar() (in XPath) and similar() (in SQL) and have two arguments:

 * relativePath: a relative path to a descendant node or {{{.}}} for the current node.
 * absoluteStringPath: a string literal that contains the path to the node for which to find similar nodes.

Examples:

{{{
//element(*, nt:resource)[rep:similar(., '/my:content/readme.txt/jcr:content')]
}}}

Finds nt:resource nodes, which are similar to {{{/my:content/readme.txt/jcr:content}}}.

{{{
select * from nt:file where similar(jcr:content, '/my:content/readme.txt/jcr:content')
}}}

Finds files that contains content similar to {{{/my:content/readme.txt}}}.

'''Note''': SQL only supports one path step for the relativePath parameter!