Skip to content

Commit 2d79581

Browse files
committed
AE Datastore Geo: Add index for plain geo query.
The Travis build is failing without this. https://travis-ci.org/GoogleCloudPlatform/java-docs-samples/builds/127329577 The docs at https://cloud.google.com/appengine/docs/java/datastore/geosearch claim: Recall that "ordinary" (non-geospatial) queries require that an index exists that contains all the properties in the query and no others. This constraint is relaxed for geospatial queries. But, this does not appear to be correct, at least not for the local devserver.
1 parent 0ce8419 commit 2d79581

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

appengine/datastore/geo/src/main/webapp/WEB-INF/datastore-indexes.xml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,10 @@
1616
<!-- The autoGenerate attribute can be true or false. We set it to false to -->
1717
<!-- allow verification that the index is correct in local tests. -->
1818
<datastore-indexes autoGenerate="false">
19-
<datastore-index kind="GasStation">
19+
<datastore-index kind="GasStation" source="manual">
20+
<property name="location" mode="geospatial" />
21+
</datastore-index>
22+
<datastore-index kind="GasStation" source="manual">
2023
<property name="brand" />
2124
<property name="location" mode="geospatial" />
2225
</datastore-index>

0 commit comments

Comments
 (0)