none
Bing Spatial Query - substringof method throws exception RRS feed

  • Question

  • In test environment, Search by Store Name functionality is not working from date 05/30 onwards. 

    Here is the error response from Bing OData spatial query to get the store information 

    { http://spatial.virtualearth.net/REST/v1/data/{0}/{1}/StoreInformation?$filter=substringof('AutoNation%20Honda%20Las%20Vegas',Name)

    %20eq%20true&$select=Latitude,Longitude,HyperionId,Name,AddressLine,

    AddressLine2,Locality,AdminDistrict,PostalCode,MainPhone,StoreUrl,

    BrandsForFiltering,CollisionUrl,CCID,ServiceIcons,PartsURL,OEMMandatedURL,

    __distance&$top=100&key={2} }

    <code>BadRequest</code>

    <message xml:lang="en-US">

            The data type of one of the parameter values is not correct. A constant value is expected.

    </message>


    Unfortunately the above calls are failing for any store search from 05/30 onwards. Not sure what the issue is. I verified the Bing map portal data source and schema. It was working prior to 05/30.

    When changed the OData query method from substringof to startswith as shown below, it returned specific store information. Could it be a syntax parsing issue from Bing side? At this point I am not sure what is going wrong.

    http://spatial.virtualearth.net/REST/v1/data/{0}/{1}/StoreInformation?$filter=startswith(Name,'AutoNation%20Honda%20Las%20Vegas')

    %20eq%20true&$select=Latitude,Longitude,HyperionId,Name,AddressLine,

    AddressLine2,Locality,AdminDistrict,PostalCode,MainPhone,StoreUrl,

    BrandsForFiltering,CollisionUrl,CCID,ServiceIcons,PartsURL,OEMMandatedURL,

    __distance&$top=100&key={2}

    Startswith doesn’t give us the same functionality as substringof gives. Startswith returns the specific result but substringof gives list of matching results. So not sure what Search by Store Name functionality is expecting. Is it wildcard search or specific store search?

    startswith            startswith(x, 'foo')           Whether the beginning of the first parameter values matches the second parameter value.

    substringof         substringof(x)

                                    substringof(x, y)              Whether the second parameter string value occurs in the first parameter string value.

    Can someone please help us with what is going wrong with substringof?






    • Edited by AutoNation Tuesday, June 4, 2013 4:13 PM
    Tuesday, June 4, 2013 2:55 PM

Answers

All replies