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 Report: Search for a user by email returns all accounts with the same domain #3173

Closed
2 tasks done
stonith404 opened this issue May 3, 2022 · 3 comments
Closed
2 tasks done
Labels
bug Something isn't working

Comments

@stonith404
Copy link

👟 Reproduction steps

Search for a user by its email adress in the console or with any sdk.

👍 Expected behavior

The response should be the user with the searched email adress.

👎 Actual Behavior

Appwrite ignores the character @ and lists all users with the same email provider (domain after the @).

Screenshot 2022-05-03 at 15 16 41

🎲 Appwrite version

Version 0.13.x

💻 Operating system

Linux

🧱 Your Environment

No response

👀 Have you spent some time to check if this issue has been raised before?

  • I checked and didn't find similar issue

🏢 Have you read the Code of Conduct?

@stonith404 stonith404 added the bug Something isn't working label May 3, 2022
@eldadfux
Copy link
Member

eldadfux commented May 4, 2022

We are thinking on adding a queries param to all "list" endpoints to allow more flexibility in this area

@stnguyen90
Copy link
Contributor

Appwrite ignores the character @ and lists all users with the same email provider (domain after the @).

Yes, the search uses MariaDB's Full Text Search in Boolean Mode (for the most part). In short, symbols are removed so that the text that is indexed becomes:

  • test123 gmail com
  • me gmail com
  • test1 gmail com

And your search for [email protected] searches for test123, gmail, or com and all of them are returned because they either have gmail or com.

One solution is to wrap your search with double quotes:

Anything enclosed in the double quotes is taken as a whole (so you can match phrases, for example).

So, search for [email protected] searches for test123 gmail com.

Given:

image

Searching "[email protected]" results in:

image

@stonith404
Copy link
Author

Thanks @stnguyen90 for your explanation that fixes it. I'll close the issue because it's not a bug.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants