Add filtering to search api requests

Anything concerning integration via the REST API
Post Reply
legosiv
Posts: 11
Joined: Thu Jan 13, 2022 10:29 am

Add filtering to search api requests

Post 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.
Post Reply