首页 > 解决方案 > 带半径的 Algolia 过滤器地理位置

问题描述

我使用 Algolia 在 Ionic 项目中使用 Firebase 进行全文搜索。我能够搜索和过滤所有对象。但是当我使用“aroundRadius”时,它什么也不返回。如果我评论“aroundRadius”并只使用“aroundLatLng”,它会返回所有数据而不关心位置。带有 lat 和 lng 的归档 _geoloc 也存在于我的数据中。

this.index.search(query,{

      filters: filters,
      aroundLatLng: location,
      aroundRadius: radius

    }).then((data) => {      
      console.log(data);
    })

我是否需要对 Indice 进行任何特殊配置或语法错误?我跟着这个链接

标签: angularfirebasealgolia

解决方案


The problem solved. Everithing is ok by codding and result. It retrurns nothing because my current location was so dar awar from the location of objects I was searching. I tried test it with browser and not a real device and it got the incorrent location.


推荐阅读