Box API Search
I'm using box search to return file Ids using the API. The file I am looking for is called:
"CF34-10 2017 FM CASH Template.csv"
When using the API it finds similarly named files, but not this one specifically. I thought it was a problem with my code, but the box UI search also never finds this file when search "CF34-10 2017 FM CASH Template.csv". I tried searching fro "2017 FM CASH Template.csv" instead, because I read that special characters cause problems. 34 pages of results come up and this particular file isn't even close to being near the top despite having a very high match rate to the search.
Seems like a pretty severe limitation and poor implementation of a search if that is true. Am I doing something wrong, or is this search function really not very good? Any advice?
Edit: After doing more experimentation it seems as though this file has just been completely eliminated from the search index somehow. Is this possible?
-
Have you tried an exact search to find the file? You can run an exact match search by putting your query in quotes and escaping the quotes with backslashes. Below is an example using our Ruby SDK.
require 'boxr' client = Boxr::Client.new('DEVELOPER_TOKEN') search_query = "\"CF34-10 2017 FM CASH Template \"" search_results = client.search(query=search_query) puts search_results
-
Hi Murtza,
do you know how to use the exact search in .NET Box.V2.SDK ?
This is my code, which does not work (I get similar results and the exact match is nowhere near the top).
var queryResult = await AdminClient.SearchManager.QueryAsync("\""+FolderName+"\"", limit: 200, offset: 0, scope: "enterprise_content", type: "folder", ancestorFolderIds: new string[] { ParentFolderId }, contentTypes: new string[] { "name" });
Furthermore, as you can see I have the ParentFolderId, but I am still using the SearchManager inside this folder instead of retrieving the sub-folders via FoldersManager.GetFolderItemsAsync() and filtering them on the client, because there is 168 thousand sub-folders, so the query itself takes 5 minutes.
It would be great if the SearchManager.QueryAsync() function provided an argument to specify that I want the search to only look at the single (top) level of the ancestorFolderIds and not traverse it's sub-folders. This would significantly reduce the number of returned results, which are usually high due to folder names do not need to be unique across vertical depth of the folder structure.
Thanks in advance for any answer!
-
How to make query optional here, I want to invoke the call like below, but API throwing bad request error.
var items = await client.SearchManager.QueryAsync(query:"", createdAfter: StartDate, createdBefore: EndDate, updatedAfter: StartDate, updatedBefore: EndDate);I want filter the data by on Dates, not with query.Thanks
サインインしてコメントを残してください。
コメント
8件のコメント