弹性搜索-如果字段具有特定值,则用GeoDistance替换其他字段

时间:2018-07-05 02:29:41

标签: elasticsearch nest

(f.GeoDistance(g => g.Address.SuburbLocation, geoDistanceFilterDescriptor => geoDistanceFilterDescriptor
                                                                                                                            .Location(term.Location.Latitude, term.Location.Longitude)
                                                                                                                            .Distance(Settings.SurroundingSuburbDistanceRange)
                                                                                                                            .DistanceType(GeoDistance.Arc)));

如果郊区位置的值为0,如何用Address.Location(其他字段)替换SuburbLocation。

g.Address.SuburbLocation == 0吗? g.Address.Location:g.Address.SuburbLocation

0 个答案:

没有答案