Progress will discontinue Telerik Platform on May 10th, 2018. Learn more

Filtering on Mixed Fields

Filtering on Mixed Fields

Using the Backend Services RESTful API, you can perform complex queries that mix a Geo Point field with multiple non-Geo-Point fields. Telerik Platform does not support filtering on two or more Geo Points simultaneously.

The next example shows how to filter on a text and a Geo Point field.

To retrieve all content items that are within 5 kilometers from a geo point named "Location" and text field containing a string "Some text" execute the following query:

//Ajax request using jQuery
var filter = {
    Text: "Some text",
    Location: {
        "$nearSphere": {
            "longitude": 23.379068, "latitude": 42.650601
        },
        "$maxDistanceInKilometers": 15
    }
};

$.ajax({
    url: 'https://api.everlive.com/v1/your-app-id/type-name',
    type: "GET",
    headers: {
        "Authorization" : "Bearer your-access-token-here",
        "X-Everlive-Filter" : JSON.stringify(filter)
    },
    success: function(data){
        alert(JSON.stringify(data));
    },
    error: function(error){
        alert(JSON.stringify(error));
    }
})
Request:
    GET https://api.everlive.com/v1/your-app-id/type-name 
Header:
    Authorization  Bearer your-access-token-here
    X-Everlive-Filter {
        Text: "Some text",
        Location: {
            "$nearSphere": {
                "longitude": 23.379068, "latitude": 42.650601
            },
            "$maxDistanceInKilometers": 15
        }
    }
Response:
    Status: 200 OK
    Content-Type: application/json
Start a free trial Request a demo
Contact us: +1-888-365-2779
sales@telerik.com
Copyright © 2016-2017, Progress Software Corporation and/or its subsidiaries or affiliates. All rights reserved.