cloudSearch:范围介于0到某个值之间的距离

时间:2016-05-07 20:53:56

标签: javascript node.js amazon-web-services amazon-cloudsearch

我想要包含距离< 500,但我得到所有文件请帮助

http://search-vegme-user-7l3rylms73566frh4hwxblekn4.us-east-1.cloudsearch.amazonaws.com/2013-01-01/search?

q=fname:'nikhil' &
expr.distance=haversin(35.621966,-120.686706,latlong.latitude,latlong.longitude)<=500&
sort=distance asc&q.parser=structured&
return=displayname,profileimageurl,distance

Click here to Run it

1 个答案:

答案 0 :(得分:0)

只需点击网址即可查看答案,还会显示如何使用结构化查询

http://search-vegme-user-7l3rylms73566frh4hwxblekn4.us-east-1.cloudsearch.amazonaws.com/2013-01-01/search?
q=(and 'nikhil' (and diet:'Vegetarian'(and categoryids:0)))
&q.parser=structured
&expr.distance=haversin(35.621966,-120.686706,latlong.latitude,latlong.longitude)
&sort=distance asc&return=distance,displayname,profileimageurl

在此之后你需要使用if和for来过滤距离