Listings search…

This topic contains 6 replies, has 4 voices, and was last updated by  Kiran 5 years ago.

We have moved to a support ticketing system and our forums are now closed.

Open Support Ticket
  • Author
    Posts
  • #515608

    Rodney Chatman
    Expired Member
    Post count: 89

    Hello,

    Is there a way to submit keywords via the API and have the API search and return based on those keywords or would I need to take the keywords, do an API GET, parse and search the return based on the keywords. I’m trying to figure out if I need to write a java search method or if I can just submit directly to the API and have the work done on the backend.
    …also, submitting device current lat/lng to the API to get location listings based on distance doesn’t seem to be working I am using

    wp-json/geodir/v2/business/?latitude=-37.699&longitude=-122.130

    as a query. No matter what lat/lng values I use, the listings show in the same order.

    #515645

    Alex Rollin
    Moderator
    Post count: 27815

    The developers have been alerted.

    #515674

    Stiofan O’Connor
    Site Admin
    Post count: 22956

    Hi Rodney,

    We have an open task for this but it is not currently implemented for the posts route, but it is possible on the markers route like /wp-json/geodir/v2/markers/?post_type=gd_place&lat=55.6789&lon=-4.1234&term[]=4&term[]=10

    For search just add “&search=term”

    Thanks,

    Stiofan

    #517092

    Kiran
    Moderator
    Post count: 7069

    Hi Rodney,

    This has been implemented and it will be in next version of GeoDirectory v2.0.0.70.

    Examples:
    1) Using Latitude & Longitude
    – latitude=xxx.xxxxxx&longitude=xxx.xxxxxx
    – Example:

    /wp-json/geodir/v2/places/?latitude=21.8380&longitude=73.7190&distance=10&orderby=distance&order=asc

    2) Using IP Address
    – ip=xxx.xxx.xxx.xxx
    – Example:

    /wp-json/geodir/v2/places/?ip=103.216.82.146&distance=10&orderby=distance&order=asc

    3) Using Near Me (auto-detects IP of the user and find nearest posts)
    – near=me
    – Example:

    /wp-json/geodir/v2/places/?near=me&distance=10&orderby=distance&order=asc

    4) Using Address
    – near=xxxxxx
    – Example:

    /wp-json/geodir/v2/places/?near=Surat&distance=10&orderby=distance&order=asc

    Regards,
    Kiran

    #517223

    Rodney Chatman
    Expired Member
    Post count: 89

    Outstanding, thanks a lot!!!

    #518000

    Rodney Chatman
    Expired Member
    Post count: 89

    Hello,

    I’ve updated to v2.0.0.70 but get the following error from the api when trying to order results by distance.

    D/OkHttp: {"code":"rest_invalid_param","message":"Invalid parameter(s): orderby","data":{"status":400,"params":{"orderby":"orderby is not one of featured_desc, overall_rating_asc, post_date_asc, post_title_asc."}}}
    #518076

    Kiran
    Moderator
    Post count: 7069

    Hi Rodney,

    Sorry for the inconvenience. Actually some part of search by near location & distance filter is in Location Manager and it will be released soon.

    Provide us FTP credentials if you want me to apply patch on your site.

    Best Regards,
    Kiran

Viewing 7 posts - 1 through 7 (of 7 total)

We have moved to a support ticketing system and our forums are now closed.

Open Support Ticket
20% Discount Offer
Hurry! Get your 20% discount before it expires. Get 20% Discount