Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] Suggest method returns InvalidRequestParameter when searching for a special character #48174

Open
lauredo opened this issue Feb 7, 2025 · 1 comment
Assignees
Labels
Client This issue points to a problem in the data-plane of the library. customer-reported Issues that are reported by GitHub users external to the Azure organization. needs-team-attention Workflow: This issue needs attention from Azure service team or SDK team question The issue doesn't require a change to the product in order to be resolved. Most issues start as that Search

Comments

@lauredo
Copy link

lauredo commented Feb 7, 2025

Type of issue

Other (describe below)

Description

I'm using SearchClient.SuggestAsync, and when searching for special or unsafe characters in the query, the following exception occurs:

Azure.RequestFailedException: 'Failed to parse query string. See https://aka.ms/azure-search-full-query for supported syntax.
Status: 400 (Bad Request)
ErrorCode: InvalidRequestParameter

Content:

json
Copiar
Editar
{
"error": {
"code": "InvalidRequestParameter",
"message": "Failed to parse query string. See https://aka.ms/azure-search-full-query for supported syntax.",
"details": [
{
"code": "InvalidSearchSyntax",
"message": "Failed to parse query string. See https://aka.ms/azure-search-full-query for supported syntax."
}
]
}
}

I have already followed the recommendation to escape special characters using "\", but the exception remains the same.

Thats how I call

var term = "###";
var filter = "tenantId eq 1";
var suggestion = await serviceClient
.SuggestAsync(term, searchConfiguration.SuggesterName,
new SuggestOptions { Filter = filter });

To reproduce, do a post to suggest with the body as shown below

Image

Thank you in advance

Page URL

https://learn.microsoft.com/pt-br/dotnet/api/azure.search.documents.searchclient.suggestasync?view=azure-dotnet

Content source URL

https://github.com/Azure/azure-docs-sdk-dotnet/blob/master/xml/Azure.Search.Documents/SearchClient.xml

Document Version Independent Id

370b8e9b-6554-bf4f-a338-6c92ef7b41bf

Article author

@azure-sdk

Metadata

  • ID: f2e8ff67-e0eb-8507-3dbb-4df2ba9371b9
  • Service: azure
@github-actions github-actions bot added Client This issue points to a problem in the data-plane of the library. customer-reported Issues that are reported by GitHub users external to the Azure organization. needs-team-attention Workflow: This issue needs attention from Azure service team or SDK team question The issue doesn't require a change to the product in order to be resolved. Most issues start as that Search labels Feb 7, 2025
Copy link

github-actions bot commented Feb 7, 2025

Thank you for your feedback. Tagging and routing to the team member best able to assist.

@jsquire jsquire assigned kinelski and unassigned ShivangiReja Feb 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Client This issue points to a problem in the data-plane of the library. customer-reported Issues that are reported by GitHub users external to the Azure organization. needs-team-attention Workflow: This issue needs attention from Azure service team or SDK team question The issue doesn't require a change to the product in order to be resolved. Most issues start as that Search
Projects
None yet
Development

No branches or pull requests

3 participants