admin管理员组

文章数量:1122978

I'm currently migrating from the Google Custom Search Site Restrict JSON API, which will be deprecated on January 8, 2025, to the Vertex AI Search API, following the official migration guide.

Previously, with Google Custom Search, I could restrict search results to a specific time period using a query parameter like sort=date:r:20220101:20221231. However, the Vertex AI Search API does not have a sort parameter.

The closest alternative I found in the documentation is the orderBy field, where the documentation suggests using a format like date:a for ascending order. When I use orderBy to replace the old sort parameter, the search works but returns drastically fewer results than expected—only 2 entries for a period that should have more, based on prior data. Without the orderBy field, even just the first page of results included 7(/25) documents. This was the same when I changed the years to 2023 and 2024. It seems that orderBy does not function as intended for time-based filtering.

Is there a correct way to use the orderBy field for filtering search results by specific dates, or is there another method in Vertex AI Search API to achieve this?

本文标签: google cloud platformDate Filtering in Vertex AI Search APIStack Overflow