Understanding the Search API query parameter
Overview
I was hoping someone could help me understand the purpose of the Search API's query parameter.
Background
I am attempting to build a program that returns all files having a particular extension that were created in a specific time period. I am making use of the file_extensions, created_at_range, and return_type parameters. I am also specifying an offset and limit.
Questions
- I am unclear what I should be specifying for the query parameter. I feel the file_extensions, created_at_range, and return_type parameters clearly define what I want returned.
- I specified a variety of arbitrary values for the query parameter and observed some strange results. When I set the query parameter equal to the file extension I am searching for, while also specifying the file_extensions parameter, no results are returned. If I set the query parameter equal to the file extension I am searching for and DO NOT specify the file extension parameter at all, all of the files I was expecting to be returned, are. Is this behavior expected and reliable?
Thank you,
Peter
-
Hello ,
I've done some testing to see what could be useful to you.
You have to have in mind that there is a mandatory field that is the query parameter. That is the only needed field. (Unless you search by metadata template that in that case you would need the mdfilters object).
So, to search for an extension I would use the same value on the query and on the file_extensions parameter:
As you can see, I've used the extension ppt on query and file_extensions. As the name of the file contains it, it works.
Maybe this way it would cover your need.
Regards,
-
I understand this is a reply to a question dated 2017.
It is still not clear to me why parameter "query" required when there are other parameters may be sufficient for searching for one or more items.
If a /search request is for items of type folder within a specific ancestor_folder_ids, then the parameter query would not be needed.
How would I use parameter query if seeking all entries that are of type folder or type file?
サインインしてコメントを残してください。
コメント
2件のコメント