You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: _includes/android/geopoints.md
+92-2Lines changed: 92 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -16,6 +16,42 @@ This point is then stored in the object as a regular field.
16
16
placeObject.put("location", point);
17
17
```
18
18
19
+
To retrieve a `ParseGeoPoint` from an object.
20
+
21
+
```java
22
+
placeObject.getParseGeoPoint("location");
23
+
```
24
+
25
+
## ParsePolygon
26
+
27
+
Parse allows you to associate polygon coordinates with an object. Adding a `ParsePolygon` to a `ParseObject` allows queries to determine whether a `ParseGeoPoint` is within a `ParsePolygon` or if a `ParsePolygon` contains a `ParseGeoPoint` .
28
+
29
+
*`ParsePolygon` must contain at least three coordinates.
30
+
31
+
For example, to create a polygon with coordinates (0, 0), (0, 1), (1, 1), (1, 0).
This point is then stored in the object as a regular field.
44
+
45
+
```java
46
+
placeObject.put("bounds", polygon);
47
+
```
48
+
49
+
To retrieve a `ParsePolygon` from an object.
50
+
51
+
```java
52
+
placeObject.getParsePolygon("bounds");
53
+
```
54
+
19
55
## Geo Queries
20
56
21
57
Now that you have a bunch of objects with spatial coordinates, it would be nice to find out which objects are closest to a point. This can be done by adding another restriction to `ParseQuery` using `whereNear`. Getting a list of ten places that are closest to a user may look something like:
As most public facing components of the SDK, `ParseGeoPoint` implements the `Parcelable` interface. This means you can retain a `ParseGeoPoint` during configuration changes, or pass it to other components of the app through `Bundles`. To achieve this, depending on the context, use either `Parcel#writeParcelable(Parcelable, int)` or `Bundle#putParcelable(String, Parcelable)`. For instance, in an Activity,
120
+
As most public facing components of the SDK, `ParseGeoPoint`and `ParsePolygon`implements the `Parcelable` interface. This means you can retain a `ParseGeoPoint` and `ParsePolygon` during configuration changes, or pass it to other components of the app through `Bundles`. To achieve this, depending on the context, use either `Parcel#writeParcelable(Parcelable, int)` or `Bundle#putParcelable(String, Parcelable)`. For instance, in an Activity,
Copy file name to clipboardExpand all lines: _includes/android/queries.md
+30-1Lines changed: 30 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -210,6 +210,35 @@ The above example will match any `BarbecueSauce` objects where the value in the
210
210
211
211
Queries that have regular expression constraints are very expensive. Refer to the [Performance Guide](#regular-expressions) for more details.
212
212
213
+
### Full Text Search
214
+
215
+
You can use `whereFullText` for efficient search capabilities. Text indexes are automatically created for you. Your strings are turned into tokens for fast searching.
216
+
217
+
* Note: Full Text Search can be resource intensive. Ensure the cost of using indexes is worth the benefit, see [storage requirements & performance costs of text indexes.](https://docs.mongodb.com/manual/core/index-text/#storage-requirements-and-performance-costs).
218
+
219
+
* Requires Parse Server 2.5.0+
220
+
221
+
```java
222
+
// Finds barbecue sauces that start with 'Big Daddy's'.
The above example will match any `BarbecueSauce` objects where the value in the "name" String key contains "bbq". For example, both "Big Daddy's BBQ", "Big Daddy's bbq" and "Big BBQ Daddy" will match.
228
+
229
+
```java
230
+
// You can sort by weight / rank. orderByAscending() and selectKeys()
0 commit comments