I have a table "products" with a few columns I'm trying to search by, but I get this error:
{
"message": "Searching by attribute \"name\" requires a fulltext index.",
"code": 400,
"type": "general_query_invalid",
"version": "1.8.1"
}```
My table does have fulltext indexes configured, so I'm not sure why I'm still getting this error - do they take some time to get setup? And how can I see the status? Are they available in the Free plan?
My code:```ts
const res = await tables.listRows<Products>({
databaseId: process.env.NEXT_PUBLIC_DATABASE_ID!,
tableId: process.env.NEXT_PUBLIC_PRODUCTS_TABLE_ID!,
queries: [
Query.equal("userId", user.$id),
...(search
? [
Query.or([
Query.search("name", search),
Query.search("brand", search),
Query.search("category", search),
]),
]
: []),
Query.select(["*", "units.*"]),
...orderQueries,
Query.orderAsc("$updatedAt"),
Query.orderAsc("$createdAt"),
Query.offset((page - 1) * perPage),
Query.limit(perPage),
],
});```
please share your table structure and list of indexes
Sorry! Meant to share this screenshot.
no worries
It seems a bit off to have the index length set to 0, but not sure if this is the issue. I would recommend trying to set it to a higher value, but I'll share this with the team
Is there a recommended length (depending on the expected content I suppose?) for FTS indexes?
yes, it's really up to your use case.
Nothing Appwrite specific
Hmm, when I select Fulltext the length input disappears?
Only available for "Key".
Got it, it might be it really is not relevant and we shouldn't even show it, but I'm checking with our databases team to be sure. They will have more insights.
Recommended threads
- All My Project is Gone
Hello everyone, please help. Why have all my projects suddenly disappeared? I received a warning via email about one of my projects being paused. When I clicked...
- CORS errors in Obsidian custom plugin
Hi, anyone here familiar with obsidian community plugins? In short: it's a local first note app which supports writing your own add-ons / plugin But I keep get...
- > AppwriteException: The requested servi...
When trying to read or write from my database I get the following error: > AppwriteException: The requested service is disabled. You can enable the service from...