Skip to content

Correct way to use GEO/GEOFILTER? #34

Closed

Description

@ethan-tr

This is a pretty basic example I put together based on the docs, but these commands yield zero search results...

FT.CREATE GeoTest SCHEMA name TEXT place GEO
FT.ADD GeoTest 158ce9ce941bce 1 FIELDS name Foo place Washington D.C. -77.0366 38.8977
FT.SEARCH GeoTest Foo GEOFILTER place -77.0366 38.8977 1 km

These are the keys the commands create...

1) "ft:GeoTest/foo"
2) "idx:GeoTest"
3) "158ce9ce941bce"

There should probably be a key called something like "geo:GeoTest/place", correct?

Activity

  1. dvirsky commented on Mar 19, 2017

    @dvirsky
    Contributor

    I think there's a problem in the way you are inserting - first of all, place can only be lon,lat. Second you need to quote multi word expressions. So it should be:

    FT.ADD GeoTest 158ce9ce941bce 1 FIELDS name "Foo" place "-77.0366 38.8977"
    

    If you want the place name add it in a different field.

  2. ethan-tr commented on Mar 19, 2017

    @ethan-tr
    Author

    That makes much more sense. Thanks!

  3. dvirsky commented on Mar 19, 2017

    @dvirsky
    Contributor

    @ethan-tr what language are you working with? Both Python and Java have clients that encapsulate those things for you.

  4. ethan-tr commented on Mar 20, 2017

    @ethan-tr
    Author
  5. dvirsky commented on Mar 20, 2017

    @dvirsky
    Contributor

    Wow! looks awesome, very nice API! I'm very happy to see this. Mind if I share it?

  6. ethan-tr commented on Mar 20, 2017

    @ethan-tr
    Author

    Thanks. I feel like it it is coming together nicely. Feel free to share.

  7. itamarhaber commented on Mar 20, 2017

    @itamarhaber
    Collaborator

    @ethan-tr totally awesome + double points for the documentation 💯

  8. mstaack commented on Mar 20, 2017

    @mstaack

    this is great

  9. added a commit that references this issue on Nov 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions