ジオコード型の標準属性で使用する場合、EQLのDISTANCE関数は、指定の参照ポイントからの該当ジオコード属性の距離に基づくフィルタを示します。
DISTANCE(geoAttribute, TO_GEOCODE(latitude,longtitude))ここで、geoAttributeは、ジオコード型の標準属性です。
ジオコード・フィルタの距離制限は、常にキロメートル単位で表されます。レコードは、ジオコード参照ポイントから緯度/経度のペアまでの距離でフィルタ処理されます。
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"> <soapenv:Header/> <soapenv:Body> <Request xmlns="http://www.endeca.com/MDEX/conversation/2/0"> <Language>en</Language> <State> <DataSourceFilterString> COUNTRY_NAME = 'United States of America' </DataSourceFilterString> <SelectionFilterString> DISTANCE(Location, TO_GEOCODE(40.758224, -73.917404)) BETWEEN 1 AND 500 </SelectionFilterString> </State> <ContentElementConfig xsi:type="RecordListConfig" HandlerFunction="RecordListHandler" HandlerNamespace="http://www.endeca.com/MDEX/conversation/handlers/2010" Id="RecordList" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> </ContentElementConfig> </Request> </soapenv:Body> </soapenv:Envelope>
問合せは、(Locationプロパティの)場所が参照ポイントから1から500キロメートルであるレコードのみを返します。
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"> <soapenv:Header/> <soapenv:Body> <Request xmlns="http://www.endeca.com/MDEX/conversation/2/0"> <State> <DataSourceFilterString> COUNTRY_NAME = 'United States of America' </DataSourceFilterString> <SelectionFilterString> DISTANCE(Location, TO_GEOCODE(40.758224, -73.917404)) > 200 </SelectionFilterString> </State> <ContentElementConfig xsi:type="RecordListConfig" HandlerFunction="RecordListHandler" HandlerNamespace="http://www.endeca.com/MDEX/conversation/handlers/2010" Id="RecordList" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> </ContentElementConfig> </Request> </soapenv:Body> </soapenv:Envelope>
問合せは、(Locationプロパティの)場所が参照ポイントから200キロメートル以上のレコードのみを返します。
「より小さい」問合せの例は、<(より小さい)演算子を使用する以外は同じです。