What values are valid for sort_field in Search Archives? #api


groups@...
 

Hi All,

I already searched the group and found one question similar to mine, but it was unfortunately unanswered. :-(

I am specifically trying to set "sort_field" in the "Search Archives" API call. Without setting it, the returned topics list is I suppose, in an order of "relevance". I want the order to be chronological.

I have reviewed the API documentation thoroughly, and "sort_field" is not defined consistently,

The usual definition for "sort_field" is: "The field to sort on. Valid values are dependent on the call." This is true for "Search Archives".

I have tried the following parameters for "sort_field" in the "Search Archives" API call, but unfortunately, none seemed to work: "id, created, subject, title, name, order". In all instances, the return messages were "sort_field": "relevance".

Is "sort_field" parameter simply un-implemented in the "Search Archives" API? Is there any chance it will be implemented, or will I simply have to perform my own sort on the returned objects?

Thanks,

-Dave

 


 

On Tue, Sep 7, 2021 at 8:57 AM <groups@...> wrote:

I already searched the group and found one question similar to mine, but it was unfortunately unanswered. :-(

I am specifically trying to set "sort_field" in the "Search Archives" API call. Without setting it, the returned topics list is I suppose, in an order of "relevance". I want the order to be chronological.

This should be fixed now. You can use `relevance` or `created`.

Cheers,
Mark 


groups@...
 

On Tue, Sep 7, 2021 at 01:04 PM, Mark Fletcher wrote:
On Tue, Sep 7, 2021 at 8:57 AM <groups@...> wrote:

I already searched the group and found one question similar to mine, but it was unfortunately unanswered. :-(

I am specifically trying to set "sort_field" in the "Search Archives" API call. Without setting it, the returned topics list is I suppose, in an order of "relevance". I want the order to be chronological.

This should be fixed now. You can use `relevance` or `created`.
Sweet -- I just tried it and it works! (And I see you've updated the docs as well. Thank you!)

-Dave