Skip to content

Commit 1363049

Browse files
author
Aries Yuwono
committed
Merge branch 'develop'
2 parents daa6dc6 + 57c546c commit 1363049

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

58 files changed

+5034
-1296
lines changed

.jshintrc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,9 @@
22
"node": true,
33
"curly": true,
44
"eqeqeq": true,
5+
"eqnull": true,
56
"noarg": true,
67
"nonew": true,
78
"undef": true,
89
"unused": true
9-
}
10+
}

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ from Node.js applications.
1414

1515
## Status
1616

17-
Release 1.0.3 of the MarkLogic Node.js API
17+
Release 1.0.4 of the MarkLogic Node.js API
1818

1919
## Sample
2020

etc/test-setup.js

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -163,6 +163,28 @@ function setup(manager) {
163163
};
164164
rangeElementIndex.push(indexdef);
165165
}
166+
167+
var geospatialElementIndex = response.data['geospatial-element-index'];
168+
169+
var pointGeospatialIndex = {
170+
'namespace-uri': '',
171+
localname: 'point',
172+
'coordinate-system': 'wgs84',
173+
'range-value-positions': false,
174+
'point-format': 'point',
175+
'invalid-values': 'ignore'
176+
};
177+
178+
if (valcheck.isNullOrUndefined(geospatialElementIndex)) {
179+
geospatialElementIndex = [pointGeospatialIndex];
180+
} else if (geospatialElementIndex.some(
181+
makeIndexTester(pointGeospatialIndex.localname)
182+
)) {
183+
geospatialElementIndex = null;
184+
} else {
185+
geospatialElementIndex.push(pointGeospatialIndex);
186+
}
187+
166188
var body = {
167189
'collection-lexicon': true,
168190
'triple-index': true,
@@ -174,6 +196,10 @@ function setup(manager) {
174196
if (valcheck.isArray(rangeElementIndex) && rangeElementIndex.length > 0) {
175197
body['range-element-index'] = rangeElementIndex;
176198
}
199+
if (valcheck.isArray(geospatialElementIndex) &&
200+
geospatialElementIndex.length > 0) {
201+
body['geospatial-element-index'] = geospatialElementIndex;
202+
}
177203

178204
console.log('adding custom indexes for '+testconfig.testServerName);
179205
return manager.put({
@@ -285,3 +311,9 @@ function setup(manager) {
285311
}
286312
});
287313
}
314+
315+
function makeIndexTester(testLocalname) {
316+
return function indexTester(index) {
317+
return (index.localname === testLocalname);
318+
};
319+
}

0 commit comments

Comments
 (0)