Page 1 of 1

Add filtering to search api requests

Posted: Sun May 22, 2022 6:58 am
by legosiv

Code: Select all

localhost/api/v4/search/documents.documentsearchresult/?__0_metadata__metadata_type__name=id_no&__0_metadata__value=12345&__0_match_all=true&__operator_0_1=AND_10&__1_document_type__label=id&__result=10&_ordering=-datetime_created
I would like to filter my results so that I will get the latest created document on top. I can do this with the GET documents route but I dont know how to do it with the search route.

To filter I just add the following to the URI on GET documents route

Code: Select all

&_ordering=-datetime_created
What is the difference between advanced and normal search? I can use match_all=true with both advanced and normal search.