Back

[SOLVED] How to get Query. Search to consider spaces.

  • 0
  • Functions
  • Web
  • Cloud
IsItBathTime
22 Jul, 2023, 11:38

Hi, I'm using the search query and it's all working but I'm having trouble searching for names which include a space. Searching for Player 1 will show all player ( 1, 2, 3 etc) how do I make player one only show player 1, player 2 only show player 2 etc

TL;DR
The user was having trouble searching for names that include a space. They found a solution by looping the query for each word. Another suggestion was to try searching for `"player 1"` instead of `player 1` (wrap with double quotes). If that didn't work, it was mentioned that the word "1" might be too short and ignored from the search index. For more information on how the search works, a link was provided.
Drake
22 Jul, 2023, 21:10

maybe you can try searching for "player 1" instead of player 1 (wrap with double quotes).

If that doesn't work, there might not be anything else that can be done because the word "1" is too short and is ignored from mariadb's search index.

For more info on how the search works, check out https://github.com/appwrite/appwrite/discussions/5005#discussioncomment-4681079

IsItBathTime
22 Jul, 2023, 21:17

That was just an example but it's ignoring everything after the space no matter the length

IsItBathTime
22 Jul, 2023, 21:18
IsItBathTime
22 Jul, 2023, 21:19

Search.select recognises spaces but it only returns names if its an exact full match, so entering bilal will so no results which is also not what I want

IsItBathTime
22 Jul, 2023, 21:22

"letters, digits, and underscores" perhaps it isn't meant to index spaces

IsItBathTime
22 Jul, 2023, 21:29
IsItBathTime
22 Jul, 2023, 21:30

I've managed to resolve it Steve by looping the query for each word

IsItBathTime
22 Jul, 2023, 21:30

Perhaps take note if anyone else runs into this issue as there's a simple solution, thanks for your help πŸ‘Œ

Drake
22 Jul, 2023, 21:33

[SOLVED] How to get Query. Search to consider spaces.

Reply

Reply to this thread by joining our Discord

Reply on Discord

Need support?

Join our Discord

Get community support by joining our Discord server.

Join Discord

Get premium support

Join Appwrite Pro and get email support from our team.

Learn more