[
https://issues.apache.org/jira/browse/OAK-319?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13954974#comment-13954974
]
Thomas Mueller commented on OAK-319:
------------------------------------
The Jackrabbit 2.x implementation, SimilarityQuery, uses roughly:
{noformat}
MoreLikeThis more = new MoreLikeThis(reader);
more.setAnalyzer(analyzer);
more.setFieldNames(new String[]{FieldNames.FULLTEXT});
more.setMinWordLen(4);
TermDocs td = reader.termDocs(TermFactory.createUUIDTerm(uuid));
Query similarityQuery = null;
if (td.next()) {
similarityQuery = more.like(td.doc());
}
td.close();
{noformat}
The uuid is the uuid of the node. No nodes are returned if the node doesn't
exist.
See also QueryConstants.OPERATION_SIMILAR.
> Similar (rep:similar) support
> -----------------------------
>
> Key: OAK-319
> URL: https://issues.apache.org/jira/browse/OAK-319
> Project: Jackrabbit Oak
> Issue Type: Sub-task
> Components: jcr, query
> Reporter: Alex Parvulescu
> Assignee: Thomas Mueller
> Priority: Critical
> Fix For: 0.20
>
>
> Test class is: SimilarQueryTest
> Trace:
> {noformat}
> Caused by: java.text.ParseException: Query:
> //*[rep:similar(.(*), '/testroot')]; expected: rep:similar is not supported
> at
> org.apache.jackrabbit.oak.query.XPathToSQL2Converter.getSyntaxError(XPathToSQL2Converter.java:963)
> {noformat}
--
This message was sent by Atlassian JIRA
(v6.2#6252)