if (keyword) {
setLoading(true);
databases
.listDocuments(
import.meta.env.VITE_PUBLIC_DATABASE_ID,
import.meta.env.VITE_PUBLIC_COLLECTION_ID,
[
Query.search("title", keyword),
Query.orderDesc("$createdAt"),
]
)
.then((response) => {
setCrafts(response.documents);
console.log(response.documents);
})
.catch((error) => {
console.error("Failed to fetch user crafts:", error);
});
setLoading(false);
}
}, [keyword]);```
I have 2 different attributes title, description
so how i can query both at the same time
It sounds like you want to have a logical OR which isn't supported at the moment. Make sure to 👍 this issue: https://github.com/appwrite/appwrite/issues/2740
I would recommend creating an attribute containing all the text you want to search across and then use that in your query
Recommended threads
- 1:1 relationship doesn’t sync after re-a...
Hi, I’m trying to use a two-way one-to-one relationship. It works fine when I create a record with the relationship set, and it also works when I unset it. But ...
- Failed to create function
Hey everyone đź‘‹ I'm having an issue creating Functions on Appwrite Cloud and I'm not sure if it's a platform bug or something wrong in my project. When I try t...
- Upsert with setting permissions
Hi there, I am using self-hosted appwrite v1.7.4 and trying to use the bulk update stuff that was released with 1.7.x. Unfortunally I found that there is an ser...