/**
* Represents a terminal node in a CQL parse-tree.
* A term node consists of the term String itself, together with,
/**
* Represents a terminal node in a CQL parse-tree.
* A term node consists of the term String itself, together with,
- * optionally, a qualifier string and a relation. Neither or both of
- * these must be provided - you can't have a qualifier without a
+ * optionally, an index string and a relation. Neither or both of
+ * these must be provided - you can't have an index without a
* <TT>relation</TT> and <TT>term</TT>. The first two may be
* <TT>null</TT>, but the <TT>term</TT> may not.
*/
* <TT>relation</TT> and <TT>term</TT>. The first two may be
* <TT>null</TT>, but the <TT>term</TT> may not.
*/
- public CQLTermNode(String qualifier, CQLRelation relation, String term) {
- this.qualifier = qualifier;
+ public CQLTermNode(String index, CQLRelation relation, String term) {
+ this.index = index;
- qual.equals("srw.resultSetName"));
+ qual.equals("srw.resultSetName") ||
+ qual.equals("cql.resultSet") ||
+ qual.equals("cql.resultSetId") ||
+ qual.equals("cql.resultSetName"));
- public String toXCQL(int level, Vector prefixes) {
+ public String toXCQL(int level, Vector<CQLPrefix> prefixes,
+ Vector<ModifierSet> sortkeys) {
return (indent(level) + "<searchClause>\n" +
renderPrefixes(level+1, prefixes) +
return (indent(level) + "<searchClause>\n" +
renderPrefixes(level+1, prefixes) +
- indent(level+1) + "<index>" + xq(qualifier) + "</index>\n" +
- relation.toXCQL(level+1, new Vector()) +
+ indent(level+1) + "<index>" + xq(index) + "</index>\n" +
+ relation.toXCQL(level+1) +
// regards truncation of the term and generation of truncation
// attributes. Change the interface to fix this.
private Vector getAttrs(Properties config) throws PQFTranslationException {
// regards truncation of the term and generation of truncation
// attributes. Change the interface to fix this.
private Vector getAttrs(Properties config) throws PQFTranslationException {
// Do this first so that if any other truncation or
// completeness attributes are generated, they "overwrite"
// Do this first so that if any other truncation or
// completeness attributes are generated, they "overwrite"
- String[] mods = relation.getModifiers();
- for (int i = 0; i < mods.length; i++) {
- attr = config.getProperty("relationModifier." + mods[i]);
+ Vector<Modifier> mods = relation.getModifiers();
+ for (int i = 0; i < mods.size(); i++) {
+ String type = mods.get(i).type;
+ attr = config.getProperty("relationModifier." + type);
// Special case: ignore relation, modifiers, wildcards, etc.
// There's parallel code in toType1BER()
return "@set " + maybeQuote(term);
// Special case: ignore relation, modifiers, wildcards, etc.
// There's parallel code in toType1BER()
return "@set " + maybeQuote(term);
// Special case: ignore relation, modifiers, wildcards, etc.
// There's parallel code in toPQF()
byte[] operand = new byte[term.length()+100];
// Special case: ignore relation, modifiers, wildcards, etc.
// There's parallel code in toPQF()
byte[] operand = new byte[term.length()+100];