Giter VIP home page Giter VIP logo

Comments (19)

atnegrete avatar atnegrete commented on June 8, 2024 3

Also upvoting this. I am not getting the prompt with the link to create the composite index. Without it, it is returning data but ignoring the composite query (where clauses).

from geoflutterfire.

momoDragon avatar momoDragon commented on June 8, 2024 3

ok the problem for me has been solved for me.
apparently the solution was not
collectionRef: query.reference() as stated by @stevenspiel
The solution was to manually create an index on firebase console.
usually when using the standard cloud firestore plugin, it would prompt you with a link to automatically make the index if needed. But in this case with this package, the message wasn't passed.
The solution to manually create the index.
more info on the solution is here:
#29

@DarshanGowda0
Take note that there was no prompt to create index given as stated that it should have on your documentation
https://pub.dev/packages/geoflutterfire
Screenshot 2020-01-01 at 11 32 29 AM

from geoflutterfire.

joknjokn avatar joknjokn commented on June 8, 2024 3

Did any of you manage to succeed using arrayContains or arrayContainsAny in combination with GeoFlutterFire and appropriate composite index?

from geoflutterfire.

momoDragon avatar momoDragon commented on June 8, 2024 2

@stevenspiel are you sure
collectionRef: query.reference()
is working?
because it's returning all the results because the .where() is being ignored

from geoflutterfire.

atnegrete avatar atnegrete commented on June 8, 2024 2

@momoDragon About to try this right now. No matter what I did, I can't get the error with the link to create the index on the console. I even wrapped it all with a try-catch and nothing!

from geoflutterfire.

momoDragon avatar momoDragon commented on June 8, 2024 1

@atnegrete I am facing the same issue as you. My where clause is being ignored when using
collectionRef: query.reference() which results in returning everything
@DarshanGowda0 can you please take a look into the issue? where clause was working perfectly fine back in the days but not it seems to be giving issues now

from geoflutterfire.

yashpaneliya avatar yashpaneliya commented on June 8, 2024 1

@The24HourClock I think there is a conflict in the name of the field (event-category) in the query and index that you have created. There is '-' in the field name but in index there isn't and also 'c' is Capital in index.

from geoflutterfire.

stevenspiel avatar stevenspiel commented on June 8, 2024

I've also been running into this.

from geoflutterfire.

stevenspiel avatar stevenspiel commented on June 8, 2024

This worked for me as soon as I called .reference() on the query to return a DocumentReference.

So, in theory, this should work for you:

var query = Firestore.instance.collection('seekers').where('position', isEqualTo: 'none');

var snap = await _geo
      .collection(collectionRef: query.reference())
      .within(center: _geo.point(latitude: lat, longitude: lon), radius: locationRadius, field: location', strictMode: false)
      .first;

return snap;

from geoflutterfire.

rolznz avatar rolznz commented on June 8, 2024

@stevenspiel It looks like the order of the keys in the composite index is important (location.geohash must be last in the list?) I managed to do it without .reference().

from geoflutterfire.

jchapuy avatar jchapuy commented on June 8, 2024

@rolznz Can you please explain how you managed to do this ? Thanks

from geoflutterfire.

momoDragon avatar momoDragon commented on June 8, 2024

@atnegrete i don't think its an error. it's a prompt to create the index. that is why a try-catch won't be executed because it is not an error. The prompt is from the cloud firestore plugin and not from the geoflutterfire probably the prompt is not being passed from the cloudfirestore plugin to the geoflutterfire fire plugin, hence we do no get the prompt being shown.

from geoflutterfire.

atnegrete avatar atnegrete commented on June 8, 2024

Interesting!

Things are somewhat working as expected manually creating that index. I have noticed that I do not get updates instantly, flipping the "strict mode" flag true/false will cause it to fetch the newer values. Probably a different issue altogether, maybe due to converting that stream into a Future (first) and something keeping the values cached on that stream?

from geoflutterfire.

TommySarkissian avatar TommySarkissian commented on June 8, 2024

I have created a composite index but for some weird reason it isn't working.

Composite Index
My composite Index

Stream

  queryStream = queryRadius.switchMap((rad) {

      var collectionReference = _firestore.collection('Broadcasts').where('event-category', isEqualTo: 'Entertainment');

      var stream = geo.collection(collectionRef: collectionReference).within(center: center, radius: rad, field: 'position', strictMode: true);

      return stream;
  }

Am I doing something wrong?

from geoflutterfire.

daseed avatar daseed commented on June 8, 2024

Did any of you manage to succeed using arrayContains or arrayContainsAny in combination with GeoFlutterFire and appropriate composite index?

I'm highly interested to know if it is possible or not. I'm currently trying to get result with an arrayContainsAny but cannot get anything.

Ok sorry it is solved for me. My index was incorrect. It is working fine now.

from geoflutterfire.

Bader-Al avatar Bader-Al commented on June 8, 2024

Wrapping the entire thing in try catch worked for me (print the error and you'll get the link to build the index automatically )

from geoflutterfire.

davemg3 avatar davemg3 commented on June 8, 2024

This issue is still there and quite annoying. If you have complex queries, it is a pain to build all indexes manually.
@DarshanGowda0, is there not a way to pass Cloud console message properly through library?
anyone having a clue?

from geoflutterfire.

J4NN0 avatar J4NN0 commented on June 8, 2024

@Bader-Al how did you manage to get output? If I put try catch as follow I don't get anything:

var query = Firestore.instance.collection('seekers').where('position', isEqualTo: 'none');

try {
  var snap = await _geo
        .collection(collectionRef: query)
        .within(center: _geo.point(latitude: lat, longitude: lon), radius: locationRadius, field: 'location', strictMode: false);
} catch (e) {...}

I have a more complicated query, therefore I would like to see the index that I need to create as I'm not managing to make it work.

from geoflutterfire.

s1dc0des avatar s1dc0des commented on June 8, 2024

hey i cant get .where and limit results...?????
any luck anyone??

from geoflutterfire.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.