I'm using the C# SDK to query ShareFile for a specific client folder as such:
var searchResults = await sfClient.Items.Search(App.selectedclient).ExecuteAsync();
foreach (SearchResult result in searchResults.Results)
The folder name is a mixture of letters and numbers following pattern (# ## Aaaaaa Aaaaa - AA).
The search results are NULL every time; i'm having no other issues with any other searches with all letters or with consecutive numbers and letters (for example, ### Aaaaaaaaa - AA). Seems like something about the space between the numbers in the search string is causing problems. Please help.
var searchResults = await sfClient.Items.Search(App.selectedclient).ExecuteAsync();
foreach (SearchResult result in searchResults.Results)
The folder name is a mixture of letters and numbers following pattern (# ## Aaaaaa Aaaaa - AA).
The search results are NULL every time; i'm having no other issues with any other searches with all letters or with consecutive numbers and letters (for example, ### Aaaaaaaaa - AA). Seems like something about the space between the numbers in the search string is causing problems. Please help.
- 4 Posts
- 2 Reply Likes
- frustrated
Posted 1 year ago
Andy Berryman, Software Engineer
- 27 Posts
- 7 Reply Likes
Can you try quoting the value that you are searching for to see if it changes the results? So instead of ... [# ## Aaaaaa Aaaaa - AA] ... you send in ... ['# ## Aaaaaa Aaaaa - AA']
- 4 Posts
- 2 Reply Likes
Results are still null after adding single quotes around the search string
If I remove the space between the numbers it returns the folder correctly, but this isn't an option as our client names have to match exactly.
If I remove the space between the numbers it returns the folder correctly, but this isn't an option as our client names have to match exactly.
- 5 Posts
- 1 Reply Like
Can you supply a code snippet of the call you're making (please remove any sensitive data) so that we can dive in deeper?
- 4 Posts
- 2 Reply Likes
To recap...
public static async Task<Folder> LoadFolderAndChildren(ShareFileClient sfClient)
{
//Search for the client folder
var searchResults = await sfClient.Items.Search(App.selectedclient).ExecuteAsync();
foreach (SearchResult result in searchResults.Results)
App.selectedclient is a string variable that represents the precise client name as it appears in ShareFile. The only client folder i'm not able to return in the searchResults object has a name with a pattern of "# ## Aaaaaa Aaaaa - AA". If I change their name to lead with "###" instead of "# ##" it returns fine.
public static async Task<Folder> LoadFolderAndChildren(ShareFileClient sfClient)
{
//Search for the client folder
var searchResults = await sfClient.Items.Search(App.selectedclient).ExecuteAsync();
foreach (SearchResult result in searchResults.Results)
App.selectedclient is a string variable that represents the precise client name as it appears in ShareFile. The only client folder i'm not able to return in the searchResults object has a name with a pattern of "# ## Aaaaaa Aaaaa - AA". If I change their name to lead with "###" instead of "# ##" it returns fine.
- 5 Posts
- 1 Reply Like
- 5 Posts
- 1 Reply Like
IQuery query = client.Items.AdvancedSearch(
new SearchQuery
{
Query = new Query
{
ItemNameOnly = true,
SearchQuery = "# ## Aaaaaa Aaaaa - AA"
}
}
);
- 5 Posts
- 1 Reply Like
If you use the advance search endpoint, setting to name only, it should work for you. Let me know if it doesn't.
Related Categories
-
ShareFile SDKs
- 275 Conversations
- 54 Followers