Share via


WhereClause.SearchOperator Property

WhereClause.SearchOperator Property

A flag (SearchOperatorFlag enumeration) that indicates whether to return results that meet all the property/value conditions (And) or any one of the property/value conditions (Or) identified in the SearchProperties property. Default is And.


Public SearchOperator As SearchOperatorFlag



[C#]

public SearchOperatorFlag SearchOperator;

Remarks

  • For example, to search for a place to eat that is open in the evenings and where French is spoken, in the Axciom.US.SIC_G.58 data source, search for SIC5812 (Eating Places) entity types. Set the SearchProperties property array to contain two elements: "HoursOfOperation" property name equal to a value of "Q" (Open Evenings), "LanguageSpokenFrench" property name equal to a value of "Y". Set the SearchOperator to And.

Example

[Visual Basic]

'Search for drive-thrus that are currently operating
Dim mySearchProperties(1) As EntityPropertyValue
mySearchProperties(0) = New EntityPropertyValue()
mySearchProperties(0).Name = "StoreOpen"
mySearchProperties(0).Value = "Y"
mySearchProperties(1) = New EntityPropertyValue()
mySearchProperties(1).Name = "StoreType"
mySearchProperties(1).Value = "Drive-Thru"

Dim findNearbySpec As New FindNearbySpecification()
findNearbySpec.DataSourceName = "MapPoint.FourthCoffeeSample"
findNearbySpec.Distance = 1
findNearbySpec.LatLong = New LatLong()
findNearbySpec.LatLong.Latitude = 47.6
findNearbySpec.LatLong.Longitude = -122.33
findNearbySpec.Filter = New FindFilter()
findNearbySpec.Filter.EntityTypeName = "FourthCoffeeShops"
findNearbySpec.Filter.WhereClause = New WhereClause()
findNearbySpec.Filter.WhereClause.SearchProperties = mySearchProperties
findNearbySpec.Filter.WhereClause.SearchOperator = SearchOperatorFlag.And

Dim foundResults As FindResults
foundResults = findService.FindNearby(findNearbySpec)



[C#]

//Search for drive-thrus that are currently operating
EntityPropertyValue[] mySearchProperties = new EntityPropertyValue[1];
mySearchProperties[0] = new EntityPropertyValue();
mySearchProperties[0].Name = "StoreOpen";
mySearchProperties[0].Value = "Y";
mySearchProperties[1] = new EntityPropertyValue();
mySearchProperties[1].Name = "StoreType";
mySearchProperties[1].Value = "Drive-Thru";

FindNearbySpecification findNearbySpec  = new FindNearbySpecification();
findNearbySpec.DataSourceName = "MapPoint.FourthCoffeeSample";
findNearbySpec.Distance = 1;
findNearbySpec.LatLong = new LatLong();
findNearbySpec.LatLong.Latitude = 47.6;
findNearbySpec.LatLong.Longitude = -122.33;
findNearbySpec.Filter = new FindFilter();
findNearbySpec.Filter.EntityTypeName = "FourthCoffeeShops";
findNearbySpec.Filter.WhereClause = new WhereClause();
findNearbySpec.Filter.WhereClause.SearchProperties = mySearchProperties;
findNearbySpec.Filter.WhereClause.SearchOperator = SearchOperatorFlag.And;

FindResults foundResults;
foundResults = findService.FindNearby(findNearbySpec);


See Also

  WhereClause Class   |   SearchOperatorFlag Enumeration   |   WhereClause.SearchProperties Property