Hi, you are probably right, that in most cases one is not interested in the node that was given to rep:similar. but I guess we cannot easily change this behavior, because of backward compatibility. maybe we can add a third optional parameter that tells the function to exclude the base node?
regards marcel Alexander Klimetschek wrote: > Hi all, > > currently, if you do a rep:similar() search [1], it will also return > the node that you specify as the base for searching other similar > nodes. Typically it will be the first search result, since the node to > itself is 100% similar. Here is an example: > > Search: > //*[rep:similar(., '/content/foobar')] > > Result (ordered by similarity by default): > - /content/foobar > - /content/other/similar/node > - /also/similar > - /not/so/similar > - /very/different > > IMHO we should exclude the node (/content/foobar) from the result, as > I think most people would not expect it there. But since this works > that way already in several released versions (rep:similar is > available since 1.4), we have to think about use cases where code > might actually rely on this behaviour. > > WDYT? > > [1] http://wiki.apache.org/jackrabbit/SimilaritySearch > > Regards, > Alex >
