rep:facet not supported in xpath
Earlier fix didn't work with 1.4 backport. So, doing this change which
should work fine across trunk, 1.6 and 1.4. Also, this seems like a
preferable approach to parse.
@@ -234,20 +234,6 @@ public class XPathToSQL2Converter {
rewindSelector();
Expression.Property p = new Expression.Property(currentSelector, "rep:excerpt", false);
statement.addSelectColumn(p);
- } else if ("rep:facet".equals(identifier)) {
- // this will also deal with relative properties
- // (functions and so on are also working, but this is probably not needed)
- Expression e = parseExpression();
- if (!(e instanceof Expression.Property)) {
- throw getSyntaxError();
- }
- Expression.Property prop = (Expression.Property) e;
- String property = prop.getColumnAliasName();
- read(")");
- rewindSelector();
- Expression.Property p = new Expression.Property(currentSelector,
- "rep:facet(" + property + ")", false);
- statement.addSelectColumn(p);
} else {
throw getSyntaxError();
}
@@ -280,6 +266,21 @@ public class XPathToSQL2Converter {
readOpenDotClose(true);
Expression.Property p = new Expression.Property(currentSelector, "rep:suggest()", false);
statement.addSelectColumn(p);
+ } else if (readIf("rep:facet")) {
+ // this will also deal with relative properties
+ // (functions and so on are also working, but this is probably not needed)
+ read("(");
+ Expression e = parseExpression();
+ if (!(e instanceof Expression.Property)) {
+ throw getSyntaxError();
+ }
+ Expression.Property prop = (Expression.Property) e;
+ String property = prop.getColumnAliasName();
+ read(")");
+ rewindSelector();
+ Expression.Property p = new Expression.Property(currentSelector,
+ "rep:facet(" + property + ")", false);
+ statement.addSelectColumn(p);
}
} while (readIf("|"));
if (!readIf(")")) {
