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
- How to Display File in Web?
I'm trying to use Appwrite's Storage to store images and display them in my app, however when I use the `getFileView`, `getFileDownload` or `getFilePreview` met...
- Project Paused Despite Daily Active Usag...
I noticed that my project was automatically **paused**, even though it is actively being used. The project is an **attendance application** that is used daily b...
- Sudden CORS Errors - Domain hasn't Chang...
I have an Appwrite project with two web apps configured, the first one has the hostname `*` and the second one I just added to test if it could fix the issue wi...