Back

how to do `OR` with full text search ?

  • 0
  • Databases
steve jobs
6 May, 2023, 19:48

how to do OR on Query.search("title", "key words") ?? i want to search if a String attribute contain "word1" or "word2" .

if it was Query.equal("title", ["Iron Man","Super man"]) i could have used a List. but for full text search ,i cant use list. so how to do a get all documents in which the 'title' contains 'word2' or 'word2' Query ?? do i have to do seperate query for each words and then combine the results ?

TL;DR
The user is asking how to perform an 'OR' operation with full text search using the Query.search() method in MariaDB. They want to search for documents where the 'title' attribute contains either "word1" or "word2". Since a list can't be used with full text search, they are asking if they need to do separate queries for each word and then combine the results. Solution: In this case, you can achieve the desired result by using the 'MATCH' operator in the full text search query. Modify the search query to "word1 OR word2" to search for documents with 'title' containing either
Drake
6 May, 2023, 19:51

So search uses mariadb's full text search. As such, you can pass space separated keywords for the search value.

FYI, https://github.com/appwrite/appwrite/discussions/5005#discussioncomment-4681079

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