在firebase firestore中使用外部orderby而不使用已用查询不等式

在firebase firestore中使用外部orderby而不使用已用查询不等式,firebase,google-cloud-firestore,geopoints,inequality,Firebase,Google Cloud Firestore,Geopoints,Inequality,在这个职位上,我是否可以作为一等兵逃离GeoPoint? 如果我从orderby中删除了GeoPoint,它会触发以下错误,如果我将GeoPoint作为第一个orderby,如下所示,它会误导第二个orderby priceSort 未捕获错误:查询无效。你有一个where过滤器 在“GeoPoint”字段上有一个不等式(=),所以 还必须将“GeoPoint”用作第一个查询。orderBy(),但 Query.orderBy()位于字段“priceSort”上 const locations=

在这个职位上,我是否可以作为一等兵逃离GeoPoint? 如果我从orderby中删除了GeoPoint,它会触发以下错误,如果我将GeoPoint作为第一个orderby,如下所示,它会误导第二个orderby priceSort

未捕获错误:查询无效。你有一个where过滤器 在“GeoPoint”字段上有一个不等式(=),所以 还必须将“GeoPoint”用作第一个查询。orderBy(),但 Query.orderBy()位于字段“priceSort”上

const locations=附近({
中心:{
纬度:4******,
经度:7*******},
半径:30000})
var db=firebase.firestore();
var AdsQry=db.集合(“ads”);
AdsQry=AdsQry
.where('GeoPoint','>',locations.lesserGeopoint)

.where('GeoPoint',”您是否尝试过这样做:

 AdsQry
    .where('GeoPoint', '>', locations.lesserGeopoint)
    .where('GeoPoint', '<', locations.greaterThan)
    .where('complete', '==', 'yes')
    //.where('countrycode', '==', 'IT')
    .orderBy('GeoPoint')
    .orderBy('priceSort', 'desc')
AdsQry
.where('GeoPoint','>',locations.lesserGeopoint)

哪里('GeoPoint','Yes,仍然是相同的结果..请在此处尝试与此相同的方法,我希望索引按编号进行相应排序您是否尝试过在Firebase控制台中为
priceSort
创建索引?如果您想按where语句中没有的字段进行排序,则需要为这两个
pr创建索引iceSort
GeoPoint
不,我不知道这个选项。谢谢你的努力,但还是一样的回答。我决定改用elasticsearch,这是我在项目中试图避免的
 AdsQry
    .where('GeoPoint', '>', locations.lesserGeopoint)
    .where('GeoPoint', '<', locations.greaterThan)
    .where('complete', '==', 'yes')
    //.where('countrycode', '==', 'IT')
    .orderBy('GeoPoint')
    .orderBy('priceSort', 'desc')