问题描述
我正在查看 https://msdn.microsoft.com/zh-CN/library/azure/dn798930.aspx :
有一个位置字段的示例,该位置字段是单个地理位置.在一个点周围进行地理搜索的功能以及进一步的功能都是很棒的,但是在现实生活中,经常有多个与单个实体相关联的地理点.一个示例是可以填补职位空缺的多个位置.进一步解释为仅允许使用字符串数组,我推断当前在天蓝色搜索中不允许每个文档的地理位置数组.
There is an example for a location field which is a single geo point. This and the further ability to geo search around a point is fantastic, however in real life situations there are quite often multiple geo points associated with a single entity. One example would be the multiple locations a job opening can be filled at. Further interpreting that only string arrays are allowed, I am extrapolating that geo point arrays per document are not allowed in azure search right now.
那是正确的吗?以及如何在不进行两次往返(到文档索引与地理位置关联的第二个索引)的情况下实现呢?
Is that correct? And how would you implement this without 2 roundtrips (to a second index where ids of documents are associated with geo points)?
一个人可能会创建4-5个地理字段,并在一个过滤器中对每个地理字段进行搜索(或"),但这会限制数量,而且我不确定从技术上讲,是否可以对多个地理搜索(例如distance(loc1)<50 OR distance(loc2)<50 OR等...
One could probably create 4-5 geo fields and search around each one (OR'd) in a filter, but that would limit the number and I am not sure it is even technically possible to OR multiple geo searches like distance(loc1) < 50 OR distance(loc2) < 50 OR etc...
谢谢
推荐答案
是的,我们目前不支持地理位置数组.如果您可能拥有的地理点数量具有合理的较高边界,则使用多个字段并使用或"过滤器的方法将起作用.
That's correct, we don't currently support arrays of geo points. If you have a reasonable higher boundary for the number of geo points you might have, your approach of having multiple fields and using an "or" filter would work.
这篇关于每个文档有多个地理属性(数组)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!