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

[search] Results that are unrelated to the query are returned #30643

Open
osamum opened this issue Aug 5, 2024 · 3 comments
Open

[search] Results that are unrelated to the query are returned #30643

osamum opened this issue Aug 5, 2024 · 3 comments
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 Service Attention Workflow: This issue is responsible by Azure service team.

Comments

@osamum
Copy link

osamum commented Aug 5, 2024

Type of issue

Code doesn't work

Description

[Enter feedback here]
When I run a vector search using the code below, the results returned are unrelated to the query.

https://learn.microsoft.com/en-us/javascript/api/overview/azure/search-documents-readme?view=azure-node-latest#querying-with-vectors

For example, even if you search for a string of completely meaningless characters, you will still get results.
The score in result is always 1 for both correct and irrelevant keywords, and rerankerScore is always undefined.
How can I use this library to retrieve only results that are relevant to the content of user query?

Page URL

https://learn.microsoft.com/en-us/javascript/api/overview/azure/search-documents-readme?view=azure-node-latest#querying-with-vectors

Content source URL

https://github.com/MicrosoftDocs/azure-docs-sdk-node/blob/main/docs-ref-services/latest/search-documents-readme.md

Document Version Independent Id

bbdda1cc-8bcc-f451-adc3-336cdc222621

Article author

@azure-sdk

Metadata

  • ID: bc0fe95b-a94f-c1e7-5d15-668e4f974b97
  • Service: search
@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 Service Attention Workflow: This issue is responsible by Azure service team. labels Aug 5, 2024
Copy link

github-actions bot commented Aug 5, 2024

Thanks for the feedback! We are routing this to the appropriate team for follow-up. cc @bleroy @MarkHeff @miwelsh @tjacobhi.

@osamum
Copy link
Author

osamum commented Aug 5, 2024

I think the cause of this problem is that "*" is specified as the first argument to the searchClient.search method.
Specifically, the following part:

const searchResults = await searchClient.search("*", {

If you replace this "*" with the keyword you want to use in your query, the score value will change correctly.
In any case, I don't know what part this searchResults returns from the Azure AI Search response, but I would be happy to be able to obtain the contents of @search.answers[] from Azure AI Search.

@jeremymeng
Copy link
Contributor

@osamum thank you for the report! We will take a look then get back to you.

@xirzec xirzec changed the title Results that are unrelated to the query are returned [search] Results that are unrelated to the query are returned Aug 6, 2024
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 Service Attention Workflow: This issue is responsible by Azure service team.
Projects
None yet
Development

No branches or pull requests

3 participants