Search Results

This topic contains 4 replies, has 3 voices, and was last updated by  Kiran 8 years, 1 month ago.

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

Open Support Ticket
  • Author
    Posts
  • #307587

    D.D
    Buyer
    Post count: 199

    Hi,

    I’m implementing search using the API but I’ve run into a limitation which also affects getting results other than search results.

    When I perform a search on my website, I get the results (10 per page) and a total number of pages, however the JSON GETrequest doesn’t give me access to a “total” for my results. I am aware that you can return as many results as you want per page but there’s nothing in the GET response that shows the total number of listings that match the search parameters.

    Cheers!

    #307888

    Paolo
    Site Admin
    Post count: 31206

    Hi,

    I flagged this for the developers who takes care of the API. He’ll let you know asap.

    Thanks

    #308194

    Kiran
    Moderator
    Post count: 7069

    Hi D.D

    The REST API request response header includes two parameters “X-WP-Total” for total number results & “X-WP-TotalPages” for total number pages.

    Check screenshot attached that shows both variables X-WP-Total & X-WP-TotalPages with relative values. Response header also includes next & previous page links.

    See this https://github.com/WP-API/WP-API/issues/662#issuecomment-64932862

    Let us know.

    #308196

    D.D
    Buyer
    Post count: 199

    Great! Seems obvious now that you point it out.

    Thanks

    #308199

    Kiran
    Moderator
    Post count: 7069

    Thanks for letting us know 🙂

Viewing 5 posts - 1 through 5 (of 5 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