Back

Searching string array using Query.contains

  • 0
  • Self Hosted
  • Flutter
DennisLBC
28 Mar, 2024, 17:25

Hey I need to search a string array for a keyword, and I think contains is the only method to do that. The problem is it that its extremely hit or miss. In testing, it will reliably work with one full word example "play", but then won't find multiple instances of "dance". Additionally, its case sensitive which is another problem as Play will not find play and vice versa. Am I missing something? Is there a better solution? I need to be able to look up documents like this.

TL;DR
Developers want to search a string array for a keyword using Query.contains but are experiencing issues. The method is hit or miss, sometimes finding one full word like "play" reliably but missing multiple instances like "dance". It is also case-sensitive. To improve, try using a loop to manually check each element or try using a regex for more flexible searching.
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