superuser.save();
List<String> r1 = new ArrayList<String>();
QueryResult result = qm.createQuery(testPath + "/*[jcr:contains(@prop1, 'foo') or jcr:contains(@prop2, 'foo') or jcr:contains(@prop3, 'foo')] order by @jcr:score descending", Query.XPATH).execute();
for (Row r : new RowIterable(result.getRows())) {
r1.add(r.getPath() + ":" + (int) (r.getScore() * 1000));
}
List<String> r2 = new ArrayList<String>();
result = qm.createQuery(testPath + "/*[jcr:contains(@prop3, 'foo') or jcr:contains(@prop1, 'foo') or jcr:contains(@prop2, 'foo')] order by @jcr:score descending", Query.XPATH).execute();
for (Row r : new RowIterable(result.getRows())) {
r2.add(r.getPath() + ":" + (int) (r.getScore() * 1000));
}
List<String> r3 = new ArrayList<String>();
result = qm.createQuery(testPath + "/*[jcr:contains(@prop2, 'foo') or jcr:contains(@prop3, 'foo') or jcr:contains(@prop1, 'foo')] order by @jcr:score descending", Query.XPATH).execute();
for (Row r : new RowIterable(result.getRows())) {
r3.add(r.getPath() + ":" + (int) (r.getScore() * 1000));
}
assertEquals(r1, r2);
assertEquals(r1, r3);