projects
/
cql-js-moved-to-github.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (from parent 1:
9dd5dd0
)
Avoid serializing redundant relation/field
author
Jakub Skoczen
<jakub@indexdata.dk>
Thu, 18 Oct 2012 13:07:26 +0000
(15:07 +0200)
committer
Jakub Skoczen
<jakub@indexdata.dk>
Thu, 18 Oct 2012 13:07:26 +0000
(15:07 +0200)
cql.js
patch
|
blob
|
history
diff --git
a/cql.js
b/cql.js
index
1f9b126
..
0a1cc75
100644
(file)
--- a/
cql.js
+++ b/
cql.js
@@
-51,10
+51,17
@@
var CQLSearchClause = function (field, fielduri, relation, relationuri,
CQLSearchClause.prototype = {
toString: function () {
CQLSearchClause.prototype = {
toString: function () {
- return (this.field ? this.field + ' ' : '') +
- (this.relation ? this.relation : '') +
+ var field = this.field;
+ var relation = this.relation;
+ if (field == 'cql.serverChoice' && relation == 'scr') {
+ //avoid redundant field/relation
+ field = null;
+ relation = null;
+ }
+ return (field ? field + ' ' : '') +
+ (relation ? relation : '') +
(this.modifiers.length > 0 ? '/' + this.modifiers.join('/') : '') +
(this.modifiers.length > 0 ? '/' + this.modifiers.join('/') : '') +
- (this.relation || this.modifiers.length ? ' ' : '') +
+ (relation || this.modifiers.length ? ' ' : '') +
'"' + this.term + '"';
},
'"' + this.term + '"';
},