Hello @Atha Dwira Perdana
Thanks for the question and using MS Q&A forum.
The error you're encountering, InvalidSearchQuery, typically indicates that there is an issue with the structure or content of your query payload. Since you mentioned that you were able to fetch up to 210,000 results before receiving the error, it could suggest that the API has limitations on the number of results returned or that the query is becoming too complex or exceeds certain thresholds.
Here are a few suggestions to consider:
Check Payload Structure: Ensure that the payload is correctly structured according to the API documentation. Double-check the required fields and their formats.
Limit Results: Since you are hitting a limit, consider implementing pagination in your requests. Instead of trying to fetch all results at once, you can use the limit and offset parameters to retrieve results in smaller batches.
Review Collection ID: Make sure that the collectionId you are using is valid and that it corresponds to the data you expect to retrieve.
API Version: Confirm that the API version you are using (2023-09-01) is compatible with the features you are trying to access.
Error Handling: Implement error handling in your code to capture and log more details about the request and response, which may provide additional insights into what might be going wrong.
For more details refer to this: Troubleshoot Microsoft Purview Data Map API request timeout exceptions
Hope this helps. Do let us know if you have any further queries.